Background: The effectiveness of glucose-lowering drugs (GLDs) is unknown among patients with dementia. Objective: To analyze all-cause mortality among users of six GLDs in dementia and dementia-free subjects, respectively. Methods: This was a longitudinal open-cohort registry-based study using data from the Swedish Dementia Registry, Total Population Register, and four supplemental registers providing data on dementia status, drug usage, confounders, and mortality. The cohort comprised 132,402 subjects with diabetes at baseline, of which 11,401 (8.6%) had dementia and 121,001 (91.4%) were dementia-free. Subsequently, comparable dementia – dementia-free pairs were sampled. Then, as-treated and intention-to-treat exposures to metformin, insulin, sulfonylurea, dipeptidyl-peptidase-4 inhibitors, glucagon-like peptide-1 analogues (GLP-1a), and sodium-glucose cotransporter-2 inhibitors (SGLT-2i) were analyzed in the parallel dementia and dementia-free cohorts. Confounding was addressed using inverse-probability weighting and propensity-score matching, and flexible parametric survival models were used to produce hazard ratios (HR) and 95% confidence intervals (CI) of the association between GLDs and all-cause mortality. Results: In the as-treated models, increased mortality was observed among insulin users with dementia (HR 1.34 [95%CI 1.24–1.45]) as well as in dementia-free subjects (1.54 [1.10–1.55]). Conversely, sulfonylurea was associated with higher mortality only in dementia subjects (1.19 [1.01–1.42]). GLP-1a (0.44 [0.25–0.78]) and SGLT-2i users with dementia (0.43 [0.23–0.80]) experienced lower mortality compared to non-users. Conclusion: Insulin and sulfonylurea carried higher mortality risk among dementia patients, while GLP-1a and SGLT-2i were associated with lower risk. GLD-associated mortality varied between dementia and comparable dementia-free subjects. Further studies are needed to optimize GLD use in dementia patients.