Nonalcoholic fatty liver disease (NAFLD) is a strong risk factor for development of type 2 diabetes, but little is known about how long-term NAFLD or its histologic features affect risk. We aimed to investigate the cumulative incidence of type 2 diabetes in patients with NAFLD and to identify histologic factors that affect risk of diabetes. We performed a retrospective study of 396 patients in Sweden diagnosed with NAFLD by biopsy analysis from 1971 through 2009 who did not have type 2 diabetes at baseline. Data on development of type 2 diabetes were collected from patient charts and national registers. Patients were categorized into groups with fibrosis stages 0-2 (n= 357) or stages 3-4(n=39). Hazard ratios of histologic parameters for type 2 diabetes development were calculated separately in a multivariate Cox regression model adjusted for sex, age, body mass index, and serum levels of triglycerides greater than 150 mg/dL. During a mean follow-up period of 18.4 years (range, 0-41 years), 132 individuals (33%) developed type 2 diabetes. A significantly higher proportion of patients with fibrosis stages 3-4(51.2%) developed type 2 diabetes than patients with fibrosis stages 0-2 (31.3%) (P=.02). For patients with fibrosis stages 0-2, fat score associated independently with development of type 2 diabetes (adjusted hazard ratio, 1.34; 95% confidence interval, 1.03-1.74; P= .03). No histologic factors associated with development of diabetes in patients with fibrosis stages 3-4. Presence of nonalcoholic steatohepatitis was not associated with development of type 2 diabetes. In a retrospective study we found a higher proportion of patients with fibrosis stages 3-4 to develop type 2 diabetes than patients with fibrosis stages 0-2. In patients with fibrosis stages 0-2, fat score associates with risk of type 2 diabetes.