An inspired display of animal ingenuity at a biomedical research institute in Texas saw a team of baboons work together to escape from the facility, briefly tasting sweet freedom outside its walls before eventually being recaptured.

The breakout, which took place on Saturday at the Texas Biomedical Research Institute (TBRI) in San Antonio, was made possible thanks to the clever use of a 55-gallon (208-litre) blue barrel.

They didn't hide in it, though. The escapees implemented their barrel as a ladder to help them scale their enclosure's walls.

Authorities at the facility, which houses almost 1,100 of the animals, became aware of the escape attempt on Saturday afternoon, later deducing that a team of the baboons had rolled one of the enclosure's barrels up against the side of their perimeter walls, using it to make their getaway.

016 baboons escape texas facility 1The baboon enclosure (TexasBiomed/YouTube)

These barrels, which were only introduced to the enclosure a number of months ago, are supposed to act as an 'enrichment item', encouraging the animals' foraging instincts and behaviour, by releasing food when the baboons roll the objects around.

It's possible, however, that all that barrel rolling stoked more than just an appetite for snacks.

"They are very smart animals," TBRI spokesperson Lisa Cruz told Gizmodo.

"We really don't know how [the barrel] got stood up, but somehow it got stood up and it happened to be in just the right spot close enough to the wall of the enclosure that the baboon was able to jump on top and then jump out.

"It's their natural inclination to get to the next highest spot to climb."

During the incident, four baboons used their makeshift ladder to scale the 35-year-old enclosure's walls, which lean inwards to prevent unassisted climbing.

Once the escapees reached the top, it seems one of the crew had second thoughts, voluntarily returning to the enclosure.

The three other absconders had no such qualms, ultimately breaching a second, less imposing barrier – the perimeter fencing around the institute – and reaching local roads, where they startled motorists and onlookers.

"It was furry and it was brown and it was pretty big," a witness, Jannelle Bouton, told KSAT News, describing one of the escaped animals.

"You can tell that [the institute staff] were panicking because they didn't want him to get hurt because they were trying their best to quarantine him, but being that kind of animal, he wasn't having it."

After a 20-minute pursuit, TBRI's animal recovery team managed to round up the three baboons at large, with the facility confirming that all animals were accounted for and were unharmed during the "unique incident".

The facility also clarified that masks worn by animal recoverers were to protect the baboons from human diseases – not the other way around – as the animals involved in the incident are not currently involved in any ongoing medical research.

That's good to know, and it's great that none of these baboons were injured while on the run, but given the ethical concerns many have over animal testing, not everybody is convinced we got a happy ending to these monkeyshines.

"This is heartbreaking," surgeon Eugene Gu wrote on Twitter.

"They earned their freedom. Let them go to a sanctuary. Some animals are too sentient to be subjected to this."