Police officers prevented a stabbing attack at a checkpoint outside Jerusalem on Sunday, an Israel Police spokesperson said.

A man ran toward a group of police at the Mazmoriya checkpoint near Jerusalem’s Har Homa neighborhood with a knife, police said.

Another officer, watching the area through a security camera, saw the man charging with the knife and warned the officers, police said in a statement.

Get The Times of Israel's Daily Edition by email and never miss our top stories Free Sign Up

Police then shot and subdued the victim before any Israeli security personnel could be injured, the statement said. He was killed, police said. Palestinian sources later identified him as Naim Ahmad Yousif Safi, from the village of al-Ubeidiya east of Bethlehem.

After the incident, the road from the Tekoa settlement in the West Bank to Jerusalem was briefly closed to traffic.

TERROR ATTACK FOILED: Palestinian terrorist attempting to stab Israelis at Mizmoria checkpoint, shot dead by IDF. pic.twitter.com/zmxBv6Nqnr — Israel News Feed (@IsraelHatzolah) February 14, 2016

Earlier on Sunday, two Palestinian teenagers were shot and killed by IDF troops when one of them opened fire at the soldiers.

The troops had been patrolling outside the Israeli settlement of Hinanit, near Jenin. The soldiers arrived in the area in response to reports of a rock throwing incident, the army said in a statement. There were no injuries on the Israeli side.