The giant cat was on the loose and seen strolling the streets of the Portola and Bernal Heights neighborhoods in San Francisco for two days.

On Wednesday night, it was found hiding in a tree on the west side of Bernal Heights, according to a Twitter post by the San Francisco Animal Care and Control (SFACC).

A day earlier, authorities noticed in footage captured of the cat that it was wearing a collar. They were later able to confirm that it had initially been marked by conservation organization the Puma Project.

“The animal had a GPS collar that Puma Project was monitoring,” Ken Paglia, Communications Officer from California Department of Fish and Wildlife (CDFW), told Newsweek.

“A GPS collar isn’t a real-time tracker that we see in cars today, it can be set to depending every 24 hours or 12 hours, etc.,” Paglia added. “They (Puma Project) may have been sharing data with us, but again it’s not real-time data.”

The cougar was taken to the Oakland Zoo after being captured, where he received a clean bill of health from the vet staff, as per SFACC’s Instagram post on Thursday.

“The mountain lion, now dubbed ‘Mr. Handsome’ by Oakland Zoo staff, is safe and sound if a bit cranky,” the caption further read, explaining he’d been captured by dart tranquilizer.

“The decision was made to dart and remove him as he didn’t seem to be making much progress on his journey out of town, and he seemed very fond of Bernal (can you blame him?).”

On Thursday, Oakland Zoo handed over the animal to the California Department of Fish and Wildlife to be released into a proper environment.

In a press release, Oakland Zoo said the two-year-old male mountain lion was a healthy weight of 98.5 lbs and was vaccinated after receiving bloodwork and treatment for parasites. For lions this age, they say, it is not unusual to see them travel ’long-range into urban neighborhoods’ in search of food, good homes, and mates.

“It’s very feasible that, this being a young male mountain lion, [he] was trying to find new territory and took a wrong turn and ended up in an urban environment,” Paglia told Newsweek.

“We take pride in doing our part to help rescue and protect animals in the wild through our partnerships and collaboration with CDFW, Bay Area Puma Project, and the San Francisco police department,” said Dr. Alex Herman, Vice President of Veterinary Services at Oakland Zoo, who performed a complete examination of ‘Mr. Handsome.’

According to the Oakland Zoo, the cougar will be released “in a rural, unpopulated area of Santa Clara County by CDFW, to continue living freely in the wild.”

Paglia told Newsweek that the animal was set free Thursday afternoon. “Our biologists took the lion to a rural natural area in Santa Clara County and released it, and essentially we call it ‘suitable habitat.’”

In recent years, according to CDFW, human-mountain lion encounters have been on the rise. More than half of California is mountain lion habitat, though their general behavior is to avoid humans and remain solitary and elusive.