The 12 young Thai soccer players who were trapped inside a flooded cave for more than two weeks last year were given ketamine to prevent them from panicking during their terrifying extraction operation, The Los Angeles Times reports. Medical professionals involved in the boys’ rescue are said to have credited the drug with ensuring that the operation went smoothly in a letter published Wednesday in the New England Journal of Medicine. The boys were anesthetized with ketamine as they “were swum out of the cave wearing poorly fitting wet suits in cold water,” the letter read. The drug kept the boys from panicking during repeated submersion in rough waters and caused their blood vessels to constrict, which decreased blood flow and made hypothermia less likely. The drug, which is known as a “dissociative anesthetic,” can be administered with an intramuscular injection, a practice anesthesiologists reportedly refer to as a “ketamine dart.” The boys—ages 11 to 17 and all members of the Wild Boars soccer team—had no diving experience and had to navigate through dark, flooded passageways to get out of the cave, all after a retired Thai Navy SEAL had already died making the same journey.