Vegan or vegetarian diets have been suggested to reduce type 2 diabetes (T2D) risk. However, not much is known on whether variation in the degree of having a plant-based versus animal-based diet may be beneficial for prevention of T2D. We aimed to investigate whether level of adherence to a diet high in plant-based foods and low in animal-based foods is associated with insulin resistance, prediabetes, and T2D. Our analysis included 6798 participants (62.7 ± 7.8 years) from the Rotterdam Study (RS), a prospective population-based cohort in the Netherlands. Dietary intake data were collected with food-frequency questionnaires at baseline of three sub-cohorts of RS (RS-I-1: 1989-1993, RS-II-1: 2000-2001, RS-III-1: 2006-2008). We constructed a continuous plant-based dietary index (range 0-92) assessing adherence to a plant-based versus animal-based diet. Insulin resistance at baseline and follow-up was assessed using homeostasis model assessment of insulin resistance (HOMA-IR). Prediabetes and T2D were collected from general practitioners' records, pharmacies' databases, and follow-up examinations in our research center until 2012. We used multivariable linear mixed models to examine association of the index with longitudinal HOMA-IR, and multivariable Cox proportional-hazards regression models to examine associations of the index with risk of prediabetes and T2D. During median 5.7, and 7.3 years of follow-up, we documented 928 prediabetes cases and 642 T2D cases. After adjusting for sociodemographic and lifestyle factors, a higher score on the plant-based dietary index was associated with lower insulin resistance (per 10 units higher score: β = -0.09; 95% CI: - 0.10; - 0.08), lower prediabetes risk (HR = 0.89; 95% CI: 0.81; 0.98), and lower T2D risk [HR = 0.82 (0.73; 0.92)]. After additional adjustment for BMI, associations attenuated and remained statistically significant for longitudinal insulin resistance [β = -0.05 (- 0.06; - 0.04)] and T2D risk [HR = 0.87 (0.79; 0.99)], but no longer for prediabetes risk [HR = 0.93 (0.85; 1.03)]. In conclusion, a more plant-based and less animal-based diet may lower risk of insulin resistance, prediabetes and T2D. These findings strengthen recent dietary recommendations to adopt a more plant-based diet.Clinical Trial Registry number and website NTR6831, http://www.trialregister.nl/trialreg/admin/rctview.asp?TC=6831 .