A raccoon stranded on the ledge of an office building in Minnesota which captivated onlookers and generated interest on social media has safely made it to the roof.

Onlookers and reporters tracking the woodland creature’s progress as it climbed the UBS Tower in St Paul breathed a sigh of relief.

St Paul Animal Control had placed a trap and some cat food on the roof, hoping to bring the raccoon down safely.

Read more: Stranded Minnesota raccoon becomes social media star

Nearby Minnesota Public Radio branded the raccoon with the hashtag #mprraccoon.

Stranded RaccoonThe raccoon sits on the ledge of an office window in the UBS Tower (Richard Tsong-Taatarii/Star Tribune via AP)

The woodland creature soon had its own Twitter account, with one tweet saying, “I made a big mistake.” There had been widespread anxiety over the raccoon’s safety.

The creature was first spotted on a ledge on Tuesday morning.