An association between psychological factors and diabetes has been suspected for a long time. However, epidemiological data on this association is limited. We investigated the association between psychological factors (perceived mental stress and type A behavior) and the onset of diabetes in a community-based, prospective cohort study in a large number of middle-aged Japanese adults. A total of 55,826 subjects (24,826 men and 31,000 women) aged 40-69 years were followed for 10 years. A self-administered questionnaire on medical conditions including diabetes and other lifestyle factors was performed at baseline and 5 and 10 years later. Psychological factors and diabetes were assessed based on the questionnaire results. During the 10-year follow-up period, we documented 1,601 incident cases (6.4%) of diabetes among men and 1,093 cases (3.5%) among women. The risk of diabetes increased with an increasing stress level, especially among men. Multivariate adjusted odds ratios for high stress compared with low stress were 1.36 (1.13 to 1.63) among men and 1.22 (0.98 to 1.51) among women. The risk of diabetes increased with an increasing level of type A behavior only among women. Multivariate adjusted odds ratios for high levels of type A behavior compared with low levels of type A behavior were 1.09 (0.94 to 1.27) among men and 1.22 (1.01 to 1.47) among women. We found an association between perceived mental stress and the incidence of diabetes, especially among men. We also found an association between type A behavior and the incidence of diabetes among women. In addition, inverse association between coffee consumption and the incidence of diabetes which was consistent with other studies was observed.