ObjectivesDepression in patients with diabetes mellitus is common and associated with poorer outcomes. This study aims to identify demographic, socioeconomic and medical factors associated with the initiation of antidepressant medication after a diagnosis of diabetes in adult patients without a previous prescription for antidepressants. We also examined frequency of primary care visits in the year after antidepressant initiation compared with the year before treatment began. MethodsThis was a retrospective cohort study using routinely collected electronic medical record data spanning January 2011 to December 2019 from the University of Toronto Practice-based Research Network (UTOPIAN) Data Safe Haven. Our primary outcome was a first prescription for an antidepressant in patients with diabetes. We used a mixed-effects logistic regression model to identify sociodemographic and medical factors associated with this event. ResultsAmong 22,750 patients with diabetes mellitus, 3,055 patients (13.4%) began taking an antidepressant medication. Increased odds of antidepressant initiation were observed in younger patients (odds ratio [OR], 1.77; 95% confidence interval [CI], 1.39 to 2.26), females (OR, 1.60; 95% CI, 1.46 to 1.7), those receiving insulin treatment (OR, 1.59; 95% CI, 1.43 to 1.78) and cases of polypharmacy (OR, 3.67; 95% CI, 3.29 to 4.11). There was an increase in the mean number of primary care visits from 4.6 to 5.9 per year after antidepressant initiation. ConclusionsIn patients with diabetes, age, sex and medical characteristics were associated with the initiation of antidepressants. These patients accessed primary care more frequently. Screening and prevention of depression, particularly in these subgroups, could reduce its personal and systemic burdens.