Abstract Background Hyperglycemia and autonomic dysfunction are bidirectionally related. The implications from former cross-sectional studies regarding the association of autonomic dysfunction and diabetes are limited due to the potential reverse causation. We aimed to investigate the association of longitudinal evolution of heart rate variability (HRV) with incident type 2 diabetes mellitus (T2D) among the general population. Methods Using data from the prospective population-based cohort study, 7630 participants with available repeated assessments of HRV, who were free of T2D and atrial fibrillation, were included. Measurements of HRV were analyzed from standard 10-s electrocardiograms records, including heart rate and two time-domain HRV markers: the heart-rate corrected standard deviation of the normal-to-normal RR intervals (SDNNc) and heart-rate corrected root mean square of successive RR-interval differences (RMSSDc). Joint models with the Bayes approach were performed to assess the associations between longitudinal evolutions of heart rate and different HRV metrics with incident T2D during follow-up. Models were adjusted for age, sex, body mass index, smoking status, systolic blood pressure, total and high-density lipoprotein cholesterol, use of blood pressure-lowering or lipid-lowering medication, and prevalent cardiovascular disease. Spearmen correlation was used to examine the associations between HRV metrics and glycemic traits (fasting blood glucose, insulin, and homeostatic model assessment of insulin resistance (HOMA-IR) and beta-cell function (HOMA-β)) at baseline. Results During a median follow-up time of 8.6 years, 871 individuals developed T2D. Based on joint models, one standard deviation (SD) increment of heart rate (hazard ratio [HR], 1.21; 95% CI, 1.09–1.34), log(SDNNc) (HR, 1.10; 95% CI, 0.94–1.27), and log(RMSSDc) (HR, 1.15; 95% CI, 1.02–1.31) was associated with the risk of developing T2D in fully-adjusted models. Subgroup analyses suggested stronger associations among men. The HRs of incident T2D per SD increment were 1.25 (1.09, 1.43) for men and 1.16 (0.99, 1.35) for women for heart rate, 1.23 (1.01, 1.51) for men and 0.97 (0.78, 1.20) for women for log(SDNNc), and 1.24 (1.05, 1.48) for men and 1.09 (0.89, 1.31) for women for log(RMSSDc). Results did not change after excluding participants who were prediabetes at baseline or after exclusion of underweight participants. Spearmen correlation indicated that heart rate was significantly associated with baseline glycemic traits, while RMSSDc was only related to fasting blood glucose. Conclusion Our study suggests that both higher heart rate and heart rate variability are associated with an increased risk of T2D development, especially among men. Funding Acknowledgement Type of funding sources: Public grant(s) – National budget only. Main funding source(s): Erasmus MC and Erasmus University Rotterdam; Netherlands Organization for Scientific Research; Netherlands Organization for Health Research and Development (ZonMw); Research Institute for Diseases in the Elderly; Netherlands Genomics Initiative; Netherlands Ministry of Education, Culture and Science; Netherlands Ministry of Health, Welfare and Sports; European Commission; and Municipality of Rotterdam. We would like to thank the China Scholarship Council for the scholarship to K.W. Forest plot