Children undergoing outpatient surgery are at risk of inadequate postoperative pain control. Methadone has a long duration of action and an intraoperative dose may provide stable analgesia throughout the postoperative period. Intraoperative methadone has been shown to improve pain control in adolescents but its use for postoperative pain in pediatric patients undergoing outpatient surgery has not been studied before. Therefore, we conducted a double-blind randomized placebo-controlled trial to investigate the effects of a single dose of intraoperative methadone in children aged less than 5 years undergoing orchiopexy for undescended testis. A total of 68 children were randomized to receive either methadone (0.1 mg/kg) or isotonic saline following induction of anesthesia. Exclusion criteria included preterm birth, previous scrotal surgery, and parents' inability to consent. Primary outcomes were opioid requirements (first primary outcome) and pain intensity in the post-anesthesia care unit. Secondary outcomes included episodes of desaturation and time until readiness to discharge from the post-anesthesia care unit, sleep on the first postoperative night, pain intensity, and opioid requirements at home until the evening on the first postoperative day. Follow-up was 4 days. Sixty children completed the study (age, mean ± SD, 26.2 ± 13.9 months), 29 children received methadone, and 31 children received placebo. Eighteen children required opioids in the post-anesthesia care unit, five children in the methadone group (proportion = 0.17, 95% confidence interval (CI): 0.07, 0.36) compared to thirteen patients in the placebo group (0.42, 95% CI: 0.26, 0.60) (mean difference = -0.24 and 95% CI: -0.03, -0.47) (p = 0.037). Five children in the methadone group (0.17, 95% CI: 0.03, 0.31) versus ten in the placebo group (0.32, 95% CI: 0.16, 0.49) had a face, legs, activity, cry, consolability score of ≥5 in the post-anesthesia care unit (mean difference = -0.15, 95% CI: -0.36, 0.06) (p = .179). More children in the placebo group woke up due to pain the first night following surgery (seven children vs. one child). The methadone group had a longer stay in the post-anesthesia care unit. There were no differences between the two groups regarding the other secondary outcomes. A single dose of intraoperative methadone reduces short-term postoperative opioid requirements in children after orchiopexy for nondescended testes but prolongs the duration of their stay in the post-anesthesia care unit.