They weren't pets — that's illegal in Australia — and they weren't from the zoo.

The three baboons that yesterday broke free from a truck in Sydney's inner west were from a research facility, where medical experiments are conducted on animals.

In fact the practice is more common than you might think — according to Humane Research Australia (HRA), there were 272 primates used in medical research in the country in 2017, with 165 of those in NSW.

Key points: Experiments are conducted on the baboons in the lab when there is "no alternative"

Experiments are conducted on the baboons in the lab when there is "no alternative" Humane Research Australia says the facility is "secretive"

Humane Research Australia says the facility is "secretive" A researcher at the facility says the animals are used in "important biomedical research"

On Tuesday, a male baboon was being transported with his two "wives" to Royal Prince Alfred Hospital (RPA) in Camperdown to have a vasectomy.

But they escaped when the lock on the truck they were in failed — bewildered onlookers filming the primates as they roamed around the hospital grounds and car park as police and staff from Taronga Zoo tried to catch them.

It was later revealed they were from a baboon colony in Wallacia, about 50km away in Western Sydney, and were purpose-bred for medical research.

Space to play or pause, M to mute, left and right arrows to seek, up and down arrows for volume. Watch Duration: 2 minutes 6 seconds 2 m 6 s Baboons returned to Sydney research facility

Secrecy surrounds experiments

The animals live at the National Health and Medical Research Council facility.

Research conducted at the lab has been used to tackle priority medical issues identified by the Federal Government including diabetes, kidney disease and complications arising from pregnancy.

Professor Annemarie Hennessy, a senior adviser at the facility, said the animals were living in an environment which resembled their natural habitat.

"They would have been completely terrified outside their comfort zone in a world they don't understand," she said of their escape.

She said baboons at the facility had been used in "important biomedical research" in Australia for at least 30 years and it was only justified where there was "no alternative".

The baboons are kept at this Wallacia research facility, which is off limits to the public. ( ABC News: Amy Greenbank )

Rachel Smith from HRA said there was no transparency about the research facility's operations.

"It's very difficult to find the information about the research that is taking place at the moment because there's a quite a lot of secrecy surrounding it," she said.

Claims of 'painful procedures'

In a research paper published last May, experiments were conducted on pregnant baboons at the lab in an attempt to find new treatment options for pre-eclampsia, a medical complication affecting up to 10 per cent of human pregnancies.

NSW Animal Justice Party MP Emma Hurst said the baboons were "medical experimentation survivors" who were attempting to flee "further painful procedures forced upon their bodies".

"These are the hidden faces behind animal experimentation in this country," she said.

Police worked with animal handlers to recapture the baboons on Tuesday. ( AAP: Joel Carrett )

The three primates were returned to the Wallacia facility late last night and the male has had his vasectomy postponed.

Baboons are known to be violent if threatened, but NSW Health Minister Brad Hazzard said the animals had "behaved impeccably".

An investigation has been launched as to why the truck's lock broke.