A raccoon that captured attention online and on social media by scaling a skyscraper in St Paul, Minnesota, has been safely trapped and will be released.

The story started yesterday morning when Minnesota Public Radio reporter Tim Nelson noticed the animal trapped on an overhang near the bottom of the UBS Building in downtown St Paul. 

"The maintenance staff came out with some two-by-fours screwed together and pushed them up to the raccoon, thinking that he would run down the boards onto the street and escape," Mr Nelson said. 

But when raccoons get scared, their instinct is to go up, and that is exactly what this one did. 

The animal was caught in a live trap on top of the UBS Tower, said Chelsey DeMers, assistant general manager of the company Wildlife Management Services.

She said the animal is in good condition and is eating.

A company technician is expected to set the animal free at a site yet to be determined.