For two weeks a team of meteorologists were trapped inside their research station on Russia’s Izvesti Tsik Islands by a group of polar bears that had taken up residence outside, in search of more food after eating one of their guard dogs.

But on Tuesday a research vessel for Russia's state-run oil firm Rosneft came to the rescue, scaring away the bears by flying a helicopter overhead. They also replaced the meteorologists' supply of signal flares to use, should the bears come back, and gave them puppies to train as future guard dogs. Now with their station clear of polar bears, they are able to wait for their regular monthly resupply.

"They came around midnight [1 p.m. ET on Tuesday]," station supervisor Vasily Shevchenko told NBC News, who is based in the city of Arkhangelsk, 1,200 miles south of the weather facility. "So there's no direct hazard near the station."

The stand-off between the scientists and the large arctic mammal that is considered to be as intelligent as some apes could illustrate what may happen as polar bears widen their search for food in the face of a shrinking habitat and encounter human populations.

While the researchers were well stocked with food, they had run out of ways to scare away the bears – typically done either with dogs or small explosions from signal flares. The scientists took to carrying guns when making trips to maintain the diesel generator in a nearby building, but even then could only use the firearms if they came under attack, since Russian polar bears are protected as an endangered species.

"The bears have actually been spending the night under our window since Saturday," station chief Vadim Plotnikov told Russian news outlet TASS. "It's dangerous to go outside, and we've had to stop some of our work."

Prior to the resupply from the research ship, the meteorologists feared that the siege would continue for another month – the time it would take a ship to reach the Kara Sea, where the Izvesti Tsik Islands are located.

Between 5,000 and 7,000 polar bears live in Russia. They are not typically on the island at this time of year, nor would they be likely to approach humans. Weather station supervisor Vasily Shevchenko told NBC News that the bears were on the island because they have nowhere to go. Global warming has caused the Arctic floating ice, the polar bear’s natural hunting ground, to melt. As a result the bears have retreated on land, becoming stuck on the islands.

The mammals on land do not have the capacity to sustain polar bears, which typically dine on fat-laden marine mammals and can eat 100 pounds of blubber in one meal. While polar bears have powerful paws that function as paddles in the water, long-distance swimming is taxing and can cause the polar bears to lose weight or put them at risk for hypothermia.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

A report released earlier this summer by the US Fish and Wildlife Service found that as a result of greenhouse gas emissions, a third of all polar bears would be in danger of going extinct in just 10 years.

"Polar bears are in big trouble," Rebecca Noblin, Alaska director for the Center for Biological Diversity, told the Associated Press in 2015. "There are other steps we can take to slow the decline of polar bears, but in the long run, the only way to save polar bears in the Arctic is to reduce greenhouse gas emissions."