Purpose: The aim of this study is to investigate the association between the use of diseasemodifying antirheumatic drugs (DMARDs) and diabetes mellitus (DM) in patients with ankylosing spondylitis (AS), rheumatoid arthritis (RA), or psoriasis/psoriatic arthritis(PS/PSA). Patients and methods: This retrospective cohort study used a nationwide, population-based administrative database to enroll 84,989 cases with AS, RA, or PS/PSA who initiated treatment with anti-tumor necrosis factor (anti-TNF) drugs or nonbiologic DMARDs. Multivariable analysis was used to estimate the effect of different therapies on the risk of DM. Results: The incidence rates of DM per 1,000 person-years were 8.3 for users of anti-TNF drugs, 13.3 for users of cyclosporine (CSA), 8.4 for users of hydroxychloroquine (HCQ), and 8.1 for users of other nonbiologic DMARDs. Compared with the users of nonbiologic DMARDs, the multivariate-adjusted hazard ratios (aHRs) for DM were significantly lower for those who used anti-TNF drugs with HCQ (aHR: 0.49, 95% confidence interval [CI]: 0.36-0.66) and those who used HCQ alone (aHR: 0.70, 95% CI: 0.63-0.78), but not for those who used anti-TNFs without HCQ (aHR: 1.23, 95% CI: 0.94-1.60) or CSA (aHR: 1.14, 95% CI: 0.77-1.70). Conclusion: The aHR for DM was lowest for patients with RA and PS/PSA who initiated treatment with an anti-TNF agent with concomitant HCQ, followed by HCQ users. Those who used anti-TNF agents without HCQ and other nonbiologic DMARDs had a similar risk of DM.