A dozen killer whales, trapped and facing near-certain death in the frozen expanse of Canada's Hudson Bay, broke free on Thursday morning, to the vast relief of locals and many thousands monitoring their plight online.

Pictures of the whales clustered around a 10-foot hole in the ice that was their last source of oxygen had set off a desperate search for rescue options.

The authorities in Inukjuak, a village of around 1,800 in northern Quebec, posted video of the distressed orcas on YouTube and Facebook on Wednesday in a bid to get the Canadian government to intervene.

By Thursday morning, however, hunters from the nearby hamlet of Inukjuak reported that changing weather conditions had broken up the ice, and the whales had swum free.

"They are free, they are gone," Johnny Williams, the town manager, said in a telephone interview. "Last night, the winds shifted from the north. The ice cracked and with the new moon, the ice went. We have open waters on the coastline of Hudson Bay."

He said the whales' escape was a huge relief for Inukjuak. Over the last few days, 80 people at a time had gone out on the ice to watch the whales. "We were all trying to find out how we can save them," he said. "We observed the wind, the moon, everything."

The whales' escape was cause for celebration elsewhere in Canada, where there had been a desperate campaign to push the government to send in ice-breaking ships to crack open the ice and help the animals find open water.

Stranding of killer whales in Arctic ice is relatively unheard of. Williams, who is 69, said in his lifetime he had only ever seen two or three carcasses of orcas before this week.

But marine biologists say killer whales are moving into the Arctic in greater numbers over the last decade as the sea ice retreats due to climate change.

Orcas face no natural predators in the Arctic, putting them at the top of the food chain.

The whales spend the summers in the Arctic, feasting on seals and narwhal and beluga whales. By the time the ice freezes, in November or December, they are miles away. A killer whale once tagged near Baffin Island had made it as far as the Azores by winter.

This year, however, the freeze came later, after the new year, and the whales were trapped. "The general picture is that most of the marine animals that can't maintain a hole in the ice move out," said Pete Ewins, a senior officer in the Arctic programme for WWF Canada. "Perhaps a less experienced pod made a mistake."

The Canadian government sent two technicians up to Inukjuak on Thursday morning to brief locals on the very limited list of options for the trapped mammals – none of which were very hopeful of the whales' survival.

Had the weather not intervened, it is likely the whales would have suffocated beneath the sea ice, or endured slow starvation until the break-up of the ice next May.

Ewins said there were few good options for the stranded whales.

Ice breakers, as demanded by the mayor of Inukjuak, were too far away from the remote region. Noise of their approach could scare off the whales, he said.

There were only two humane options, he said, which were to fly the whales out by giant helicopters – which would be prohibitive in the Arctic – or install equipment to keep the water moving and ice-free. "The only option would be to put in bubbling equipment to keep enough open water and hope that the whales have enough fat deposits to keep them through to May," he said.

In previous incidents of stranding of belugas, narwhals or other whales that are common in the Arctic, the authorities have resorted to killing the animals outright, to avoid slow starvation and painful death, he said.

In the event, however, nature took its course, freeing the whales before the list of bad options had to be explored.

"I am just very glad," said Megan Epoo, whose elderly uncle was the hunter who originally spotted the stranded whales. "The men here had announced they were going to try and make the breathing hole bigger, and remove the ice from the side of the hole, and that would have been very dangerous. So we were all very worried that something bad would happen," she said.

"But now nobody has to do anything because the whales are free."