IMPORTANCE Androgen deficiency is common among male opioid users, and opioid use has emerged as a common antecedent of testosterone treatment. The long-term health outcomes associated with testosterone therapy remain unknown, however. OBJECTIVE To compare health outcomes between long-term opioid users with testosterone deficiency who filled testosterone prescriptions and those with the same condition but who did not receive testosterone treatment. DESIGN, SETTING, AND PARTICIPANTS This cohort study focused on men in the care of the Veterans Health Administration (VHA) facilities throughout the United States from October 1, 2008, to September 30, 2014. It included male veterans who were long-term opioid users, had low testosterone levels (<300 ng/dL), and received either a testosterone prescription or any other prescription. It excluded male patients with HIV infection, gender dysphoria, or prostate cancer and those who received testosterone in fiscal year 2008. Data were analyzed from April 1, 2017, to April 30, 2019. EXPOSURE Prescription for testosterone. MAIN OUTCOMES AND MEASURES All-cause mortality and incidence of major adverse cardiovascular events (MACE), vertebral or femoral fractures, and anemia during the 6-year follow-up through September 30, 2015. RESULTS After exclusions, 21 272 long-term opioid users (mean [SD] age, 53 [10] years; n = 16 689 [78.5%] white) with low total or free testosterone levels were included for analysis, of whom 14 121 (66.4%) received testosterone and 7151 (33.6%) did not. At baseline, compared with opioid users who did not receive testosterone, long-term opioid users who received testosterone treatment were more likely to have obesity (43.7% vs 49.0%; P < .001), hyperlipidemia (43.0% vs 48.8%; P < .001), and hypertension (53.9% vs 55.2%; P = .07) but had lower prevalence of coronary artery disease (15.9% vs 12.9%; P < .001) and stroke (2.4% vs 1.3%; P < .001). After adjusting for covariates, opioid users who received testosterone had significantly lower all-cause mortality (hazard ratio [HR] = 0.51; 95% CI, 0.42-0.61) and lower incidence of MACE (HR = 0.58; 95% CI, 0.51-0.67), femoral or hip fractures (HR = 0.68; 95% CI, 0.48-0.96), and anemia (HR = 0.73; 95% CI, 0.68-0.79) during the follow-up period of up to 6 years, compared with their counterparts without a testosterone prescription. In covariate-adjusted models, men who received opioids plus testosterone were more likely to have resolved anemia compared with those who received opioids only during the 6-year follow-up (HR = 1.16; 95% CI, 1.02-1.31). Similar results were obtained in propensity score-matched models and when analyses were restricted to opioid users with noncancer pain or those who did not receive glucocorticoids. (continued) Key Points Question What are the health outcomes among long-term opioid users who receive testosterone treatment compared with opioid users who do not? Findings In this cohort study of 21 272 male long-term opioid users with testosterone deficiency, those who received opioids plus testo...