Symptomatic androgen deficiency is common in patients taking opioid analgesics, as these drugs potently suppress the hypothalamic-pituitary-gonadal axis. However, the efficacy of testosterone replacement in this setting remains unclear. The objective of this trial was to evaluate the efficacy of testosterone replacement on pain perception and other androgen-dependent outcomes in men with opioid-induced androgen deficiency. We conducted a randomized, double-blind, parallel placebo-controlled trial at an outpatient academic research center. Participants were men aged 18 to 64 years on opioid analgesics for chronic noncancer pain, and total testosterone levels were <350 ng/dL. Participants were randomly assigned to 14 weeks of daily transdermal gel that contained 5 g of testosterone or placebo. Primary outcomes were changes in self-reported clinical pain and objectively assessed pain sensitivity. Sexual function, quality of life, and body composition were also assessed. The mean age was 49 years. The median total and free testosterone levels at baseline were 243 ng/dL and 47 pg/mL and 251 ng/dL and 43 pg/mL in the testosterone and placebo arm, respectively. Of the 84 randomized participants, 65 had follow-up data, on efficacy outcomes. compared with men assigned to the placebo arm, those assigned to testosterone replacement experienced greater improvements in pressure and mechanical hyperalgesia, sexual desire, and role limitation due to emotional problems. Testosterone administration was also associated with an improvement in body composition. There were no between-group differences in changes in self-reported pain. In conclusion, in men with opioid-induced androgen deficiency, testosterone administration improved pain sensitivity, sexual desire, body composition, and aspects of quality of life.