A two-day mission to save an injured man who fell and got trapped in a cave in the Brecon Beacons mountain range in Wales, ended Monday night when the unnamed individual was finally rescued and brought back to the surface.

The man, in his 40s, spent two days stuck in Ogof Ffynnon Ddu, the deepest cave in the United Kingdom. Gathering over 300 mountain rescuers and volunteers, officials said that it was the “longest stretcher carry in British cave rescue history.”

Some rescuers were reportedly in the cave for over 12 hours in 30 person shifts, as new volunteers would relieve the mountaineers of the strenuous rescue mission to lift the injured man out safely.

Rescuers from the South and Mid Wales Cave Rescue Team had to maneuver the injured caver through “technically challenging” and dangerous terrain after he fell Saturday around 1:00 p.m in Brecon Beacons. A young caver discovered him and ran out to alert authorities, but the man did not surface again until Monday night at around 7:45 p.m.

Investigators are trying to figure out what happened, but the injured man is recovering in the hospital with a broken jaw, a broken leg, and several spinal injures. None of the injuries are life-threatening, according to The Independent, but will take some time to recover.

Gary Evans, one of the leading emergency service officers, told reporters that, “The casualty is doing remarkably well, if you consider how long he’s been in the cave.”

Evans said he was “absolutely delighted” that they were able to stretcher the injured man out. “We’re delighted because it was a difficult rescue and we’re delighted because the casualty has done really well considering what’s happened,” he said.

According to Evans, they had some of the best mountain and cave rescuers on hand, with some emergency responders present also involved in the 2018 Thai cave rescue of 12 young boys and their soccer coach.

South and Mid Wales Cave Rescue Team spokesman Peter Francis said that it was the longest rescue they’ve ever done and that the “caver was very unlucky here.”

“He’s an experienced caver, a fit caver. And it was a matter of putting his foot in the wrong place,” he explained. “He wasn’t in a dangerous part of the [Brecon Beacons] cave, it’s just something moved from under him.”

According to The Independent, only experienced mountain climbers and cave explorers are even allowed to traverse Ogof Ffynnon Ddu in Brecon Beacons, where the man fell. One caver told The Guardian that he would describe the cave’s inner workings as “intestinal.”

“Its approximate 61 km of passages provide everything from huge chambers, beautiful formations, to yawning chasms and thundering river passages,” the Brecon Beacons mountain website reads.

Thick fog and drizzling rain also marred their rescue mission, which prevented a helicopter from being able to land in Brecon Beacons and airlift him out. Luckily, since it’s a popular mountaineering destination, the Rescue Team has their headquarters right one of the entrances.

“We regularly practice in it,” said Gary Mitchell, one of the rescue mission volunteers. “There’s a bigger volume underground than you would have in other caves, so you are going to get accidents, people get lost, get stuck, run out of lights.”

“Cavers are a relatively small, slightly strange bunch,” he said. “Many of us know each other. Actually, it was a bit like a social reunion because people are coming across the country who you don’t see very often.”

Reuniting to save a fellow caver, the two-day operation went off without a hitch. The rescue team was able to get two responders down to him in the first crucial hours to access his situation, as well as give the man oxygen and pain killers for his injuries. After over 50 hours underground, the man is reportedly healing in a nearby hospital.

“We had really good early information,” volunteer Gary Mitchell said. “That is a game-changer.”