A screen grab shows boys rescued from the Thai cave wearing mask and resting in a hospital in Chiang Rai, Thailand from a July 11, 2018.

Twelve boys trapped in a Thai cave were given ketamine to help protect them from hypothermia during the harrowing rescue, the effort's medical team wrote in a letter to the New England Journal of Medicine.

Last summer, the boys and their soccer coach were exploring Thailand's Tham Luang cave complex when a downpour flooded the tunnels. British divers found the Wild Boars soccer team more than a week after they were reported missing. Rescuers placed the boys on stretchers and swam them out of the narrow cave.

For more on investing in health-care innovation, click here to join CNBC at our Healthy Returns Summit in New York City on May 21.

The boys' wet suits fit poorly and the water was cold, the medical team said in its letter to the Journal, published online Wednesday. Rescuers wrote that oxygen levels were falling and they needed to keep the boys from developing hypothermia, so they gave them "unspecified doses" of ketamine and a face mask filled with oxygen.