New security footage was released Monday showing a dramatic stabbing attempt at the Damascus Gate of Jerusalem’s Old City Saturday that left three officers wounded.

The video shows a man sitting on the side of a walkway being guarded by Border Police, when he pulls a knife out of his back pocket and attempts to stab an officer, who manages to get away.

The attacker then tries to stab other officers, who quickly surround and kill him.

The footage was apparently recorded on a cellphone by somebody with access to security camera footage of the incident.

According to a police recounting of the incident, the officer and a fellow cop had approached the youth, who was said to be behaving in a suspicious manner. They asked to see his identification. After handing over his ID card, the 19-year-old pulled out a knife and stabbed one of the officers in the neck.

Three security officers were wounded in the incident, all from friendly fire.

A nearby group of officers from anti-terror unit Yasam saw the attack unfold and opened fire, killing the attacker but also accidentally hitting two Border Police officers and one of their own, according to the police statement.

The wounded officers were taken to hospital for treatment.

The terrorist was named by Israeli media as Muhammad Ali, 19, from Shuafat in East Jerusalem.

The incident was the second stabbing attack in the city on Saturday. Earlier in the day, a Palestinian teenager stabbed two ultra-Orthodox men in central Jerusalem. One of the victims was moderately injured while the other sustained light wounds.

Police have stepped up security in the Old City and the Lions’ Gate and Damascus Gate areas in the wake of the attacks, boosting the presence of cops and installing metal detectors.

Times of Israel staff contributed to this report.