A raccoon stretches itself on the window sill on the 23rd floor of the UBS Plaza in St. Paul, Minnesota on Tuesday. The raccoon captivated onlookers as it scaled the office building. (Evan Frost/AP)

This story has been updated.

A raccoon that became an Internet sensation by climbing a 25-story office tower in downtown St. Paul, Minnesota, was safely trapped early Wednesday, and animal control officials released it back into the wild.

The raccoon looked a bit bedraggled but healthy after it was caught before dawn atop the UBS Plaza. Technicians took the caged raccoon down a freight elevator to a truck, according to Wildlife Management Services, which provides animal control services for St. Paul.

“It’s definitely a healthy raccoon. It’s in good condition. It’s eating normally,” said Christina Valdivia, the company’s general manager, who accompanied the technicians to the rooftop.

Wildlife officials caught the raccoon on the roof Wednesday and then released the animal into the wild. (Evan Frost/AP)

The raccoon’s adventures caused a stir on social media as it scaled the tower Tuesday, with many Twitter users voicing concern for its safety or joking about the drama as its seemingly death-defying climb was live-streamed by several broadcasters. Valdivia said her mother-in-law saw it on the news in Chile.

The animal made it to the roof early Wednesday, where traps baited with cat food were waiting. The raccoon, a female, was released later in the day and scampered into a wooded area on private property near the Twin Cities suburb of Shakopee.

Minnesota Public Radio, which broke the story and closely followed the raccoon’s climb from its headquarters less than a block away, branded the animal #mprraccoon.

Among those riveted was Suzanne MacDonald, a raccoon behavior expert at York University in Toronto, Canada.

“Raccoons don’t think ahead very much, so raccoons don’t have very good impulse control,” MacDonald said, admitting she could barely sleep she was so worried about the animal. “I don’t think the raccoon realized when it started climbing what it was in for.”

Some people following the raccoon’s journey on social media suggested the animal needed rescuing. A wildlife rehabilitation official said he wasn’t sure that was true. (Paige Donnelly Law Firm/Reuters)

Initial speculation was that the raccoon climbed to a lower part of the building, frequented by pigeons, in search of bird eggs. But workers who tried to lure her down with a wooden ramp probably just scared her, said Phil Jenni, executive director of the Wildlife Rehabilitation Center of Minnesota.

So she did what raccoons do when they’re stressed: She climbed.

It’s not unusual for raccoons to climb fairly tall trees and other structures, according to MacDonald and Jenni, though neither had heard of one climbing such a tall building.

MacDonald said one raccoon grabbed attention in 2015, after climbing 699 feet up a construction crane in Toronto. It safely climbed down on its own.

Jenni said the outpouring of concern online was encouraging, but he noted it’s often best to leave wild animals alone.

“The narrative that developed was this raccoon was stranded and needed rescuing. I’m not sure that was true. It was behaving like a lot of raccoons do,” he said.