ImportanceNecrotizing enterocolitis (NEC) requiring surgical intervention is the most common reason for surgical procedures in preterm neonates. Opioids are used to manage postoperative pain, with some infants requiring methadone to treat physiologic opioid dependence or wean from nonmethadone opioid treatment during recovery.ObjectiveTo describe postoperative opioid use and methadone treatment for infants with surgically treated NEC and evaluate postoperative outcomes.Design, Setting, and ParticipantsA cohort study of infants with surgically treated NEC admitted from January 1, 2013, to December 31, 2022, to 48 Children’s Hospital Association hospitals contributing data to the Pediatric Health Information System (PHIS) was performed. Infants who received methadone preoperatively, were aged 14 days or less at the time of the operation, had a congenital heart disease–related operation, or died within 90 days of the operation were excluded. Mixed-effects multivariable logistic regression was used to evaluate thresholds for duration of opioid use after the operation associated with methadone treatment and clinical outcomes associated with methadone use were enumerated.ExposurePostoperative administration of nonmethadone opioids.Main Outcomes and MeasuresMethadone use and postoperative length of stay, ventilator days, and total parenteral nutrition (TPN) days.ResultsOf the 2037 infants with surgically treated NEC identified, the median birth weight was 920 (IQR, 700.0-1479.5) g; 1204 were male (59.1%), 911 were White (44.7%), and 343 were Hispanic (16.8%). Infants received nonmethadone opioids for a median of 15 (IQR, 6-30) days after the operation and 231 received methadone (11.3%). The median first day of methadone use was postoperative day 18 (IQR, days 9-64) and continued for 28 days (IQR, 14-73). Compared with infants who received nonmethadone opioids for 1 to 5 days, infants receiving 16 to 21 days of opioids were most likely to receive methadone treatment (odds ratio, 11.45; 95% CI, 6.31-20.77). Methadone use was associated with 21.41 (95% CI, 10.81-32.02) more days of postoperative length of stay, 10.80 (95% CI, 3.63-17.98) more ventilator days, and 16.21 (95% CI, 6.34-26.10) more TPN days.Conclusions and RelevanceIn this cohort study of infants with surgically treated NEC, prolonged use of nonmethadone opioids after the operation was associated with an increased likelihood of methadone treatment and increased postoperative length of stay, ventilation, and TPN use. Optimizing postoperative pain management for infants requiring an operation may decrease the need for methadone treatment and improve health care use.