We aimed to assess whether current antidepressant therapy or a history of hospital-diagnosed depression affects diabetes treatment initiation, adherence, and HbA1c and LDL-cholesterol target achievement.In this register-based study, we included all individuals from Central and Northern Denmark with newly diagnosed type 2 diabetes, defined as a first-ever HbA1c measurement of ≥48 mmol/mol (6.5%), between 2000 and 2016. Individuals either diagnosed with depression at a psychiatric hospital in the 2 years prior to their diabetes diagnosis or currently receiving treatment with an antidepressant were compared with individuals with type 2 diabetes, but without depression treatment or previous history of depression. Outcome measures included initiation of glucose-lowering drugs and lipid-modifying agents, adherence to these medications (medication possession ratio >80%), and HbA1c (<53 mmol/mol [7%]) and LDL-cholesterol (<2.6 mmol/l) target achievement. The assessment of association between depression or antidepressant treatment and these outcomes was conducted using regression analyses with adjustment for potential confounders.We included a total of 87,650 individuals with first-ever HbA1c-diagnosed type 2 diabetes, of whom 0.9% (n = 784) had hospital-diagnosed depression and 11.4% (n = 9963) currently received antidepressant treatment. Compared with those without depression treatment, treatment with an antidepressant was associated with increased likelihood of glucose-lowering drug initiation (HR 1.39 [95% CI 1.34, 1.44]) and adherence (OR 1.27 [95% CI 1.18, 1.36]), lipid-modifying agent initiation (HR 1.17 [95% CI 1.11, 1.23]) and adherence (OR 1.25 [95% CI 1.09, 1.43]), and achievement of LDL (OR 1.08 [95% CI 1.03, 1.14]) but not HbA1c target (OR 0.99 [95% CI 0.93, 1.06]). The findings were similar for individuals who had hospital-diagnosed depression.In individuals with newly diagnosed type 2 diabetes, antidepressant treatment and depression were associated with improved diabetes treatment quality. Graphical abstract.