He must have known what was coming.

A male baboon on his way to a vasectomy in Australia managed to escape before the procedure with his two female companions — and ran amok on hospital grounds, according to new reports.

New South Wales Health Minister Brad Hazzard told the Australian Associated Press that a lock had failed either on the truck or crate that was transporting the 15-year-old male and two female baboons just as they arrived at the Royal Prince Alfred Hospital in Sydney Tuesday afternoon.

“The three baboons decided to take a bit of a look around RPA grounds,” Hazzard told the outlet. “They didn’t know what to do nor did the people around them.”

Video obtained by The Sydney Morning Herald shows the trio running alongside parked cars as stunned people look on.

“Last I heard they’d had a good look around the precinct and ended up in the carpark where they were behaving far better than what we’d expect of baboons,” Hazzard told the Herald. “They obviously decided that inspecting the premises was an appropriate way to spend a couple of hours at the hospital.”

People calling in to Sydney radio station 2GB were the first to report the bizarre primate sightings.

“Mate I’m deadset serious, I’m at RPA, I’m six floors up and I was just having a gaze out at the carpark … and there were three baboons in the carpark,” one witness said. “I’m deadset serious. They even had shiny red bottoms.”

Responding police ultimately called in experts from Taronga Zoo to help round up the rogue baboons, according to the Herald. Zoo staffers were expected to sedate them and bring them back to the hospital.

The mischievous trio was not at the hospital for research purposes, but so the male baboon could have a vasectomy to live out the rest of his life “quietly and peacefully” with the rest of his troop in the suburb of Wallacia, the Herald reported.

“They don’t want him to continue breeding with the small troop he’s in,” Hazzard told the paper. “So in order for him to stay, the decision was taken that he should have a vasectomy.”

The females were there simply “to keep him calm,” the health minister said.