A polar bear attack in Canada that left two people injured has brought new warnings from scientists of a dangerous rise in human-bear encounters in a warming Arctic.

The friends had just walked out of the door in the pre-dawn hours after a party when the young polar bear crept up behind them, unheard and unseen.

By the time, the bear was driven off by neighbours wielding a shovel, banging pots and pans, and firing multiple rounds from a shotgun, two people were badly mauled: the young woman who was the original target of the attack and an older male neighbour who tried to come to her rescue.

The episode – the second violent human-bear encounter since September – has deeply shaken this small town of 900 on Hudson Bay, known as the polar bear capital of the world.

It has also prompted new warnings from scientists of the rising risks of human-polar bear encounters because of climate change, with starving bears coming off the ice and onto land looking for food.

The attack in the centre of Churchill occurred at about 5am on 1 November, when a young couple offered to walk a friend home from a Halloween party.

Walking in numbers is a common safety precaution in the town in October and November, as polar bears move off the land towards the newly frozen ice on the bay.

“We got about 10 steps out of the door when it happened. I turned around, and it was already right there trotting after us,” said Nikki Pilek, who works at a local restaurant and had volunteered to walk the victim home. She felt the bear touch her. “ I fell down and I thought it was me.”

Pilek came out of the close encounter without injury, as did a male companion, Mike Buffi. But the bear chased her friend, identified only as Erin, onto the porch of a neighbouring house, wounding her and the homeowner, retired tour guide Bill Ayotte, who came out with a shovel to beat back the bear.

Neighbours who witnessed the episode said the bear had flung the young woman up against the wall of the house, and was biting at her head when Ayotte intervened.

He ran out swinging with a shovel, distracting the bear and giving the bloodied young woman a chance to flee inside his home. But the bear turned on Ayotte, knocking him to the ground and pouncing on his chest.

Other neighbours then ran out onto their porches, firing shotguns in the air, banging pots and pans, and throwing snow boots.

But the bear did not loosen its grip on Ayotte until another neighbour, Didier Foubert-Allen, ran for his truck and drove towards the animal with high beams blazing.

The startled animal ran off towards the town's main street.

The bear, described by witnesses as a sub-adult was later shot dead by Manitoba conservation officials. Another bear, a mother with a cub, was also shot dead in the aftermath of the episode. The cub was tranquilised and taken to Winnipeg zoo.

The episode has unsettled this small town on the edge of the Arctic, which depends on the income from tourists hoping to catch a sighting of a polar bear.

By Sunday night, the injured woman had been released from a Winnipeg hospital after treatment for lacerations to her head, ear and arm.

Ayotte remained in hospital with severe lacerations to his face, stomach and ears.

“It was crazy,” said Leanne Dyck-Foubert, a neighbour. “There were people outside banging pots and pans together.”

Her roommate, Sara Scales, said: “The entire street was up. It was like a play. Everyone was screaming and crying.”

The injured woman – like many of the first-hand witnesses to the attack – was a seasonal worker who came to Churchill for restaurant work during the busy tourist season.

So was the victim in September's attack, a young man, also walking late at night, who eventually scared off the bear by lighting up his cell phone.

Ayotte was a long-term resident, and experienced in dealing with bears.

A number of those who saw the attack declined to speak about it. Buffi, who had left the party with Pilek and the injured woman, would offer only a formal statement:

“I am glad everyone is alive. It was a horiffic surreal event that I wish upon nobody,” he said.

The attack was also a reminder of a warming Arctic under climate change. The loss of sea ice is bringing hungry bears into closer contact with humans as they hunt for food, with potentially lethal consequences for both, scientists said.

“The number of bear-human interactions, bear-human conflicts, may be somewhat on the rise,” said Steven Amstrup, chief scientist for Polar Bears International.

“ We have predicted in no uncertain times that as bears become hungrier as the sea ice absence period is longer, more and more of these animals are going to be venturing into communities, venturing into villages, raiding food caches, getting into garbage, and even attacking people. So we predict these kinds of events are going to be more frequent and more severe because of climate change.”