Background Little is known about the long-term (>2 years) relationship between the time-varying drug adherence and healthcare utilization for patients with diabetes. Objective To characterize the relationship between time-varying anti-hyperglycemic medication adherence and healthcare utilization in patients with diabetes, using data from Alberta’s Tomorrow Project, a population-based cohort study in Alberta, Canada. Methods Incident cases of diabetes with at least 24 months of follow-up were included in the study. Anti-hyperglycemic drug adherence was measured by proportion of days covered (PDC) in the past 12 months for each year after diagnosis. The rate of healthcare utilization was assessed for the subsequent 12 months, 36 months and 60 months. A time-varying, negative binomial generalized estimating equation model was used to examine the association between medication adherence and healthcare utilization. Results Among 2155 incident cases of diabetes, average age at diagnosis was 59.6±9.3, 51.0% were female and average duration of follow-up was 7.3±3.7 (range, 2.0–16.2) years. The proportion of patients taking anti-hyperglycemic medications was 47.6% during the first year of diagnosis, which increased to 77.3% by the end of follow-up. Compared to adherent patients (PDC≥0.8), non-adherent patients (PDC<0.8) had substantially higher rate of all-cause hospitalization [incident rate ratio, IRR=1.48 (1.22–1.79), ED visits [1.30 (1.15–1.47)] and GP visits [1.17 (1.08–1.27)] in the subsequent 12 months. However, these associations became weaker with longer follow-up [eg, IRR=1.18 (0.98–1.39) and 1.05 (0.94–1.18) for all-cause hospitalization in the subsequent 36 and 60 months, respectively]. Conclusion Poor adherence among diabetic patients was associated with substantially higher rate of healthcare utilization in the short term (eg, 12 months); however, this association weakened over a longer period (eg, 36–60 months).