Hyperglycemia and autonomic dysfunction are bidirectionally related. We investigated the association of longitudinal evolution of heart rate variability (HRV) with incident type 2 diabetes (T2D) among the general population. We included 7630 participants (mean age 63.7 years, 58% women) from the population-based Rotterdam Study who had no history of T2D and atrial fibrillation at baseline and had repeated HRV assessments at baseline and during follow-up. We used joint models to assess the association between longitudinal evolution of heart rate and different HRV metrics (including the heart-rate corrected standard deviation of the normal-to-normal RR intervals (SDNNc), and root mean square of successive RR-interval differences (RMSSDc)) with incident T2D. Models were adjusted for cardiovascular risk factors. Bidirectional Mendelian randomization (MR) using summary-level data was also performed. During a median follow-up of 8.6 years, 871 individuals developed incident T2D. One standard deviation (SD) increase in heart rate (hazard ratio [HR], 1.20, 95% confidence interval (CI), 1.09-1.33), and log(RMSSDc) (1.16, 95% CI 1.01-1.33) were independently associated with incident T2D. The HRs were 1.54 (95% CI 1.08-2.06) for participants younger than 62 years and 1.15 (95% CI 1.01-1.31) for those older than 62 years for heart rate (p for interaction <0.001). Results from bidirectional MR analyses suggested that HRV and T2D were not significantly related to each other. Autonomic dysfunction preceeds development of T2D, especially among younger individuals, while MR analysis suggests no causal relationship. More studies are needed to further validate our findings.