OBJECTIVES The association between coffee consumption, type 2 diabetes and impaired glucose tolerance was examined. In addition, indicators of insulin sensitivity and beta-cell function according to homeostasis model assessment were studied in relation to coffee consumption. DESIGN Population-based cross-sectional study. SETTING AND SUBJECTS The study comprised 7949 healthy Swedish subjects aged 35-56 years residing within five municipalities of Stockholm. An oral glucose tolerance test identified 55 men and 52 women with previously undiagnosed type 2 diabetes and 172 men and 167 women with impaired glucose tolerance. Information about coffee consumption and other factors was obtained by questionnaire. RESULTS The relative risks (adjusted for potential confounders) of type 2 diabetes and impaired glucose tolerance when drinking >/=5 cups of coffee per day compared with </=2 cups per day in men were 0.45 [95% confidence intervals (CI) 0.22-0.92] and 0.63 (CI: 0.41-0.97), respectively, and in women 0.27 (CI: 0.11-0.66) and 0.47 (CI: 0.29-0.76) respectively. In subjects with type 2 diabetes and impaired glucose tolerance, high coffee consumption (>/=5 cups day(-1)) was inversely associated with insulin resistance. In addition, in those with type 2 diabetes and in women (not in men) with impaired glucose tolerance high coffee consumption was inversely associated with low beta-cell function. In women, but not obviously in men, with normal glucose tolerance, coffee consumption was associated with a reduced risk of insulin resistance. CONCLUSIONS The results of this study indicated that high consumers of coffee have a reduced risk of type 2 diabetes and impaired glucose tolerance. The beneficial effects may involve both improved insulin sensitivity and enhanced insulin response.