A review in the New England Journal of Medicine by physicians Anand and Hickey laid out the anatomical and chemical evidence that newborns, including premature infants, have working pain pathways, and that withholding anesthesia had been standard practice anyway.
Anand and Hickey compiled evidence that the nerve pathways and stress hormone systems needed to register pain are functional late in gestation. Earlier that year, Anand's trial in premature infants undergoing heart surgery found that fentanyl anesthesia produced smaller stress hormone spikes and fewer complications than the minimal anesthesia then standard.
The review helped shift clinical practice within a few years, as hospitals moved toward giving infants the same anesthesia standards used for older patients. Trial data on complications and public pressure also drove the shift, and researchers continued refining how to measure and manage pain in infants for decades afterward.

Read the original study
Anand and Hickey, NEJM, 1987 · doi.org/10.1056/nejm198711193172105
Pain had been there the whole time.
Source
- Anand, K., & Hickey, P. (1987). Pain and Its Effects in the Human Neonate and Fetus. New England Journal of Medicine, 317(21), 1321–1329. https://doi.org/10.1056/nejm198711193172105