Scientists finally understand how a colony of ants survived for years in a cold, dark bunker: cannibalism.

The wood ants had fallen through a ventilation pipe into a Soviet-built bunker, once used to store nuclear weapons, in the forests of Poland. Once inside, they were trapped with only other worker ants and millions of corpses.

The plight of those ants is detailed in an October study published in the Journal of Hymenoptera Research.

Here's their harrowing tale.

A colony of ants recently escaped a Soviet-era bunker in Poland, once used to store nuclear weapons.

BusinessInsider USA Images

Wojciech Stephan

Researchers studying wood ants in the forests of Poland first stumbled upon the unfortunate colony in 2013. They estimated that almost one million ants were inside the bunker, but couldn't tell how long they'd been trapped there.

The bunker had been part of a Soviet nuclear base from the late 1960s to 1992.

The scientists only found worker ants in the bunker, with no queen and no larvae.

BusinessInsider USA Images

Wojciech Stephan

The ants didn't seem to produce any offspring, likely due to low temperatures and lack of food.

The bunker colony grew as ants from the original colony, in the forest above, fell through a ventilation pipe beneath their nest.

BusinessInsider USA Images

Wojciech Stephan

In total darkness, the bunker colony built its own mound from dirt on the bunker floor.

Freedom was always just out of reach. Since they couldn't move along the ceiling, the ants couldn't climb back up the pipe.

BusinessInsider USA Images

Wojciech Stephan

The researchers could get in and out of the bunker through cracks that the ants couldn't access. They started to think about how they could help the ants escape.

The ants' food source remained a mystery until the researchers came back in 2016 and examined some of the two million ant corpses piled up around the bunker.

BusinessInsider USA Images

Wojciech Stephan

"I wasn't surprised," co-author and ant ecologist Mak Istvn told Popular Science . "It was a logical option for them to survive in this way."

Of the corpses that the researchers collected, 93% had bites or holes indicating that other ants had eaten them. The living ants had punctured the abdomens of dead ants to suck out their innards, "like opening a can," Istvn said.

The researchers only examined dead ants that still had their abdomens, to avoid double-counting pieces of the same corpses.

Then the scientists noticed an old wooden plank leaning against the bunker wall. The trail of ants climbing to the ceiling began there.

BusinessInsider USA Images

Wojciech Stephan

Maybe the researchers could provide direct access to the ventilation pipe.

So they set up a 9-foot "boardwalk" from the ants' mound to the ventilation pipe above.

BusinessInsider USA Images

Wojciech Stephan

"It was meant to serve as an escape route, allowing the ants to leave the bunker," the researchers wrote .

Before the research team left, they noted that some ants started inspecting the boardwalk right away.

When researchers returned to the bunker a few months later, all but a few stray ants were gone, leaving behind piles of partially cannibalized corpses.

BusinessInsider USA Images

Wojciech Stephan

In the end, the scientists marveled at the ants' perseverance and adaptability.

"The ecological and behavioural flexibility of the wood ants may allow them survival even in unexpectedly suboptimal conditions," they wrote .

See Also:

SEE ALSO: 13 creepy photos of the microscopic world around us that will make your skin crawl

DON'T MISS: At least 3 companies plan to launch space hotels into orbit, offering inflatable rooms, 16 sunsets per day, and even space Quidditch