LONDON — A knife-wielding attacker wearing a hoax explosive vest injured several people Friday during an assault on London Bridge that police say they are treating as a terrorist attack. Video widely shared on social media shows a group of bystanders wrestling the suspect to the ground before he is fatally shot by police.

In the dramatic footage, one member of the public can be seen fleeing the scene holding a large knife — allegedly taken from the hands of the attacker to prevent him from inflicting further damage. In the video, other members of the public can be seen surrounding the suspect and seemingly helping police officers restrain him.

Two people died as a result of the knife attack, British media reported. They were identified initially only as members of the public. The attacker was shot dead by police.

In remarks Friday, London Mayor Sadiq Khan praised the “breathtaking heroism” of those who grappled with the suspect, saying: “I’d also like to thank members of the public who risked their own safety this afternoon. They are the best of us.”

In a statement after the attack, British Prime Minister Boris Johnson paid tribute to the police, emergency services personnel and “extraordinary bravery” of the members of the public who were involved in the incident. “They represent the very best of our country and I thank them on behalf of all of our country,” Johnson said.

Those who helped stop the suspect in his tracks join the ranks of a number of ordinary people from around the world who have demonstrated extraordinary courage.

From Britain to New Zealand, witnesses have time and time again faced excruciating choices in the face of imminent danger, risking — and at times losing — their lives to try to save others.

Britain, 2017

On June 3, 2017, three terrorists also wearing fake explosive vests drove into pedestrians on London Bridge before going on a stabbing rampage through the capital’s bustling Borough Market. The attackers, who were later fatally shot by British police, killed eight people.

As the attack commenced, Spanish banker Ignacio Echeverría challenged the attackers, clutching only his skateboard as a weapon. The 39-year-old was killed while attempting to save a woman being targeted by the attackers.

“It was like he didn’t even think about it, but reacted immediately,” Echeverria’s friend said in a statement. Last year, Echeverría’s parents accepted Britain’s George Medal for bravery on their son’s behalf.

Elsewhere in the market, others attempted to distract and challenge the attackers by hurling pint glasses, bottles and abuse at them as they waited for police to arrive.

One British soccer fan, Roy Larner, 47, who was drinking pints with friends at the time of the attack, decided to tackle the trio, shouting a vulgar chant in support of his favorite team as he did so. Larner was stabbed eight times in the neck, head and hands but lived to tell the tale.

He has since had a beer named after him.

During a knife attack at an Underground station in east London in 2015, police used a stun gun on the perpetrator, who reportedly yelled “This is for Syria!” as he wounded three people.

But what garnered the most attention was the voice of an onlooker captured in footage of the incident, shouting repeatedly, “You ain’t no Muslim, bruv!” at the suspect. (“Bruv” is the British slang equivalent of the American “bro.”)

The comments went viral and trended as a hashtag on social media, as Brits praised the bystander for distancing the attacker’s actions from Islam. Then-British Prime Minister David Cameron called it a “brilliant statement” in a news conference about the incident.

“Some of us have dedicated speeches and media appearances and sound bites and everything to this subject,” he said. “But ‘You ain’t no Muslim, bruv,’ said it all much better than I ever could.”

New Zealand, 2019

When a white-supremacist gunman went on a shooting rampage in two New Zealand mosques in March, he killed more than 50 people and wounded dozens of others.

At least one of his victims died trying to stop him.

Video footage released after the attacks showed Naeem Rashid, 50, trying to tackle the alleged gunman, 28-year-old Brenton Tarrant, outside one of the mosques. The father of three, who had immigrated to New Zealand from Pakistan a decade earlier, was hailed as a hero in his home country after his death. Prime Minister Imran Khan awarded him a posthumous bravery award, and tweeted that he was “martyred” while trying to stop the gunman. Pakistan also declared a national day of mourning after the attack.

“My brother was a brave man who died to save others,” Khurshid Alam, Rashid’s brother, told The Washington Post in a telephone interview at the time. “His death showed how he cared for humanity.”

Norway, 2019

In August, Mohammad Rafiq, an unarmed 65-year-old, stopped a gunman from attacking a Norwegian mosque by throwing him to the floor. The retired Pakistani military officer said the heavily armed suspect fought back, punching him in the face and shoving his finger into his eye.

Rafiq’s effort to thwart what could have been another deadly mosque shooting was supported by two other men inside al-Noor Islamic Center who rushed to help pin down the aggressor.

Norwegian police said the men showed “great courage” and confirmed that they were treating the attack as a suspected act of terrorism.

Australia, 2019

In a video shared to Twitter and viewed more than 4 million times, “Significantly brave” bystanders used chairs and a milk crate to trap a man during a stabbing rampage in Sydney in August.

“I ran outside and saw people grabbing poles and bats from a firetruck and started to chase [the man] up the street,” a witness told 10 Daily.

The man, who killed one person and wounded another, was chased through the streets by witnesses who united in a desperate effort to prevent him from hurting anyone else.

Police identified the suspect as Mert Ney, 21, the Sydney Morning Herald reported at the time. Authorities told the newspaper they did not consider the attack terrorism-related but were investigating. Ney has a history of mental health issues, the Morning Herald reported.

Karla Adam and William Booth contributed to this report.