Type 2 diabetes (T2D) treatment has changed markedly within the last decades. We aimed to explore whether people with severe mental illness (SMI) have followed the same changes in T2D treatment as those without SMI, as multiple studies suggest that people with SMI receive suboptimal care for somatic disorders. In this registry-based annual cohort study, we explored the T2D treatment from 2001 to 2015 provided in general practices of the Greater Copenhagen area. We stratified the T2D cohorts by their pre-existing SMI status. T2D was defined based on elevated glycated hemoglobin (≥48 mmol/mol) or glucose (≥11 mmol/L) using data from the Copenhagen Primary Care Laboratory Database. Individuals with schizophrenia spectrum disorders (ICD-10 F20-29) or affective disorders (bipolar disorder or unipolar depression, ICD-10 F30-33) were identified based on hospital-acquired diagnoses made within 5 years before January 1 each year for people with prevalent T2D or 5 years before meeting our T2D definition for incident patients. For comparison, we defined a non-SMI group, including people who did not have a hospital-acquired diagnosis of schizophrenia spectrum disorders, affective disorders, or personality disorders. For each calendar year, we assembled cohorts of people with T2D with or without SMI. We used Poisson regression to calculate the rates per 100 person-years of having at least one biochemical test (glycated hemoglobin, low-density lipoprotein cholesterol, estimated glomerular filtration rate, and urine albumin-creatinine ratio), having poor control of these biochemical results, taking glucose-lowering or cardiovascular medications, or experiencing a clinical outcome, including all-cause mortality and cardiovascular mortality. Three outcomes (cardiovascular events, cardiovascular mortality, and all-cause mortality) were additionally examined and adjusted for age and sex in a post hoc analysis. From 2001 to 2015, 66,914 individuals were identified as having T2D. In 2015, 1.5% of the study population had schizophrenia spectrum disorder and 1.4% had an affective disorder. The number of people who used biochemical tests or had poor biochemical risk factor control was essentially unrelated to SMI status. One exception was that fewer LDL cholesterol tests were done on people with affective disorders and schizophrenia spectrum disorders at the beginning of the study period compared to people in the non-SMI group. This difference gradually diminished and was almost nonexistent by 2011. There was also a slightly slower rise in UACR test rates in the SMI groups compared to other people with T2D during the period. Throughout the study period, all groups changed their use of medications in similar ways: more metformin, less sulfonylurea, more lipid-lowering drugs, and more ACEi/ARBs. However, people with schizophrenia disorder consistently used fewer cardiovascular medications. Cardiovascular events were more common in the affective disorder group compared to the non-SMI group from 2009 to 2015 (rate ratio 2015 : 1.36 [95% CI 1.18-1.57]). After adjustment for age and sex, all-cause mortality was significantly higher among people with a schizophrenia spectrum disorder each year from 2003 to 2015 compared to the non-SMI group (rate ratio 2015 : 1.99 [95% CI 1.26-3.12]). Persons with schizophrenia or affective disorders demonstrated the same treatment changes for T2D as those without SMI in general practice. The lower use of most types of cardiovascular medications among people with schizophrenia disorders indicates potential undertreatment of hypertension and dyslipidemia and remains throughout the study period. Cardiovascular events were most common among people with affective disorders, but this was not reflected in a higher proportion using cardiovascular preventive medications. This knowledge should be considered in the management of this vulnerable patient group.