A Jordanian citizen stabbed an Israeli police officer in the neck and head near Jerusalem’s Old City early on Saturday afternoon and was shot dead by the policeman, police said.

The assailant was identified by Hebrew media as Muhammad Abdullah Salim al-Kassji, a 57-year-old Jordanian citizen who entered Israel several days ago.

The 37-year-old police officer was taken to Jerusalem’s Shaare Tzedek medical center in moderate condition after the incident near the Lions’ Gate. He had wounds in the neck and head, and was conscious and in stable condition when evacuated to the hospital.

A second man was lightly wounded, with cuts to the hand.

Police spokeswoman Luba Samri said the attacker pulled a knife and stabbed the officer, and that the officer responded by opening fire and killing his attacker.

Magen David Adom paramedics said they provided emergency treatment at the scene.

Israeli security forces in Jerusalem's Old City after a stabbing attack in which one police officer were injured and the assailant was shot and killed by Israeli police, on May 13, 2017. (Flash90)

Israeli security forces in Jerusalem’s Old City after a stabbing attack in which one police officer were injured and the assailant was shot and killed by Israeli police, on May 13, 2017. (Flash90)

A video uploaded by the Palestinian Quds News Network (graphic) appeared to show the aftermath of the attack, with policemen attending to the injured officer and the alleged attacker lying inert on the ground.

Knives carried by the assailant in an attack outside the Old City of Jerusalem on May 13, 2017 (Israel police)

Knives carried by the assailant in an attack outside the Old City of Jerusalem on May 13, 2017 (Israel police)

The attack came two days after Israeli prosecutors on Thursday indicted a Palestinian man at the Jerusalem District Court for the murder of a British exchange student in a stabbing attack on Jerusalem’s light rail last month.

In that terror attack, Jamil Tamimi, 57, allegedly stabbed to death 21-year-old Hannah Bladon, who was in Israel as part of a study abroad program at the Hebrew University of Jerusalem.

On Sunday, a teenage Palestinian female assailant who attempted to stab police officers was shot dead by security forces at the Damascus Gate. According to police, the girl approached a group of officers who were standing guard at the gate.

“The terrorist arrived from Sultan Suleiman Street toward the steps of the Damascus Gate. She approached a police and border guard force stationed in the area. She took out a knife and while screaming ‘Allahu Akhbar’ tried to attack them,” the spokesperson said. “The force responded with determination and professionalism, and neutralized her,” the spokesperson added.

The assailant was 16-year-old Fatima Hajiji, a resident of Qarawat Bani Zeid, north of Ramallah, according to the Palestinian health ministry.