Armed police officers open fire and shoot dead the three attackers in video footage of chaotic scenes in Borough Market. Warning: the video contains graphic images that some viewers may find distressing

The armed police officers who stopped an attack by three men in London on Saturday night came close to being stabbed themselves, dramatic new footage shows.

A video shows the attackers rushing towards the police marksmen and trying to kill them, with armed officers opening fire and shooting them dead in defence of their own lives and the lives of others.

Eight officers shot the attackers dead, minutes after the three drove into pedestrians on London Bridge and then stabbed people in Borough Market, leaving eight dead.

The video surfaced on social media and shows the end of Saturday’s atrocity. It was filmed in Borough Market, a place popular with Londoners and tourists for an evening out, surrounded by restaurants and pubs. Sources have confirmed it is genuine.

It shows the three attackers: Khuram Butt, 27, Rachid Redouane, 30, and Youssef Zaghba, 22. First, they try to enter a pub, but its doors have been barricaded as the jihadis have already stabbed others.

They then set upon a young man passing by. Another passerby throws a chair to try to stop the attack, and then a City of London police armed response vehicle (ARV) screeches into frame, with three armed officers rushing out of their vehicles in an attempt to save the man.

If the armed officers showed any hesitation, it is not visible in the video: they rush at such speed that one physically clashes with one of the attackers and both fall to the floor. The officer gets up and raises his weapon.

Just feet away, another attacker is rushing at an officer, trying to stab him. The officer moves back in order to aim his weapon, firing and nearly falling over.

The video shows chaotic scenes and the extent of danger the officers faced, as well as the callousness of the attackers as they set upon their victims.

No more than 20 seconds elapse from the officers leaving their ARV to the attackers lying still on the floor. In that time, as well as firing more than three dozen shots, the officers saw canisters draped around the upper body of the three attackers and assessed them to be suicide vests. Two Met ARVs also arrived.

Armed officers from the City of London and the Met regularly train together and the Guardian understands that the marksmen involved soon returned to duty despite their ordeal, joining a manhunt as police believed there could still be attackers on the loose.

By law, the police shooting of suspects has to be independently investigated by the Independent Police Complaints Commission.

In a statement, the IPCC said: “We can confirm that 46 shots in total were fired by eight police officers – three officers from City of London police and five from the Metropolitan police service. We are examining CCTV footage from within Borough Market which we believe shows the majority of the incident relevant to our investigation.”

In a statement, the Met said: “We are aware of images that are circulating on social media.”