The animal had broken into a storage room at the Isfjord Radio hotel in Svalbard, Norway, and had been stuck there overnight.
When guide Malin Stark first spotted the broken door and muddy paw prints outside, she said her first reaction was irritation. It had only recently been replaced after the last door was also destroyed by a polar bear.
WATCH: Hidden cameras reveal secret lives of bear family in Sweden
Looking inside the building, she saw that several bags of food waste had been opened and wine bottles smashed -- and then heard a sound that revealed the uninvited guest was still there. Even at that point though, Stark says she didn't feel fear but rather "an adrenaline rush".
The bear was stuck in the hut for several hours. Photo: Malin Stark
The next task was to get the bear -- who by this point was peeking out of the building's window -- to leave. The door had slammed shut behind it, and the hut's broken windows showed he had made several attempts to escape.
"With a stressed bear that has been stuck for several hours, it's not the time to try to go and open a door for him," Stark told Swedish daily Aftonbladet.
At that point, the staff at the hotel contacted the Governor of Svalbard, which represents the Norwegian government on the remote island and sent over a team including a bear expert.
As it turned out, the sound of the governor's helicopter overhead was enough to prompt the bear to escape, wriggling through a window before jumping into the sea.
IN PICTURES: Polar bears mate outside Norwegian weather station
The bear fled from the building, apparently with an injured paw. Photo: Malin Stark/The Local
None of the nine guests or five employees at the hotel at the time were injured, and guests only leave the hotel in the company of a trained guide due to the risk of encountering the animals.
READ ALSO: How a Swedish hotel reunited a bear with his best friend
The hotel is over 90 kilometres from the nearest town, only accessible by boat or snowmobile, and until recently the site served as a radio station for communication between Svalbard and mainland Norway.
In Sweden, there are no wild polar bears, though the country's forests are home to other potentially dangerous animals, including brown bears and elk.