To investigate whether the genetic burden of type 2 diabetes modifies the association between the quality of dietary fat and the incidence of type 2 diabetes.Individual participant data meta-analysis.Eligible prospective cohort studies were systematically sourced from studies published between January 1970 and February 2017 through electronic searches in major medical databases (Medline, Embase, and Scopus) and discussion with investigators.Data from cohort studies or multicohort consortia with available genome-wide genetic data and information about the quality of dietary fat and the incidence of type 2 diabetes in participants of European descent was sought. Prospective cohorts that had accrued five or more years of follow-up were included. The type 2 diabetes genetic risk profile was characterized by a 68-variant polygenic risk score weighted by published effect sizes. Diet was recorded by using validated cohort-specific dietary assessment tools. Outcome measures were summary adjusted hazard ratios of incident type 2 diabetes for polygenic risk score, isocaloric replacement of carbohydrate (refined starch and sugars) with types of fat, and the interaction of types of fat with polygenic risk score.Of 102 305 participants from 15 prospective cohort studies, 20 015 type 2 diabetes cases were documented after a median follow-up of 12 years (interquartile range 9.4-14.2). The hazard ratio of type 2 diabetes per increment of 10 risk alleles in the polygenic risk score was 1.64 (95% confidence interval 1.54 to 1.75, I2=7.1%, τ2=0.003). The increase of polyunsaturated fat and total omega 6 polyunsaturated fat intake in place of carbohydrate was associated with a lower risk of type 2 diabetes, with hazard ratios of 0.90 (0.82 to 0.98, I2=18.0%, τ2=0.006; per 5% of energy) and 0.99 (0.97 to 1.00, I2=58.8%, τ2=0.001; per increment of 1 g/d), respectively. Increasing monounsaturated fat in place of carbohydrate was associated with a higher risk of type 2 diabetes (hazard ratio 1.10, 95% confidence interval 1.01 to 1.19, I2=25.9%, τ2=0.006; per 5% of energy). Evidence of small study effects was detected for the overall association of polyunsaturated fat with the risk of type 2 diabetes, but not for the omega 6 polyunsaturated fat and monounsaturated fat associations. Significant interactions between dietary fat and polygenic risk score on the risk of type 2 diabetes (P>0.05 for interaction) were not observed.These data indicate that genetic burden and the quality of dietary fat are each associated with the incidence of type 2 diabetes. The findings do not support tailoring recommendations on the quality of dietary fat to individual type 2 diabetes genetic risk profiles for the primary prevention of type 2 diabetes, and suggest that dietary fat is associated with the risk of type 2 diabetes across the spectrum of type 2 diabetes genetic risk.