Heart rate variability (HRV) is reduced in diabetes mellitus (DM) patients, suggesting dysfunction of cardiac autonomic regulation which has been associated with increased risk for cardiac events. In this paper, we examined the associations of blood glucose level (BGL) and duration of diabetes with autonomic nervous system (ANS) function assessed by HRV analysis. Resting HRV and BGL measures of 32 healthy controls and 54 type 2 DM (T2DM) patients were analyzed. HRV data were analyzed using time-domain, frequency-domain and nonlinear methods. HRV parameters showed a clear difference between controls and T2DM patients. BGL correlated negatively with mean RR interval. In addition, a decrease in HRV was observed in hyperglycemia, most clear changes shown in triangular interpolation of RR interval histogram (TINN), root mean square of successive RR interval differences (RMSSD) and Poincar´e plot index SD1. Duration of diabetes was clearly associated with decreased HRV, shown by decreases in standard deviation of RR intervals (SDNN), HRV triangular index (HRVi), TINN, LF power and Poincar´e plot index SD2. Glycemic values were not associated with disease duration.