Two Israelis hurt in a terror attack near Jerusalem’s Old City died of their injuries Wednesday night, hospital officials said.

One victim, who was accidentally shot by police during the stabbing attack, was named as Ofer Ben-Ari, 46, of Jerusalem. He is survived by his wife and two children, according to reports.

The second man was named as Reuben Birmajer, a rabbi in the Spanish program of the Aish Hatorah yeshiva in the Old City.

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

Birmajer had sustained critical wounds during the attack, which took place next to the Old City’s Jaffa Gate in Jerusalem early Wednesday afternoon.

“He spent the morning teaching Torah and was murdered on his way out of the Old City,” Rabbi Steven Burg, who heads the yeshiva, wrote on Facebook.

A third man remained in serious condition after sustaining stab wounds during the attack. He was not named.

The fatalities bring the death toll in nearly three months of attacks by Palestinians in Israel and the West Bank to 24, including at least one other person hit by friendly fire. More than 100 Palestinians have died — the majority of them killed in the course of their attacks on Israelis.

Wednesday’s attack was carried out by two Palestinian stabbers, both of whom were shot by policewomen at the scene. One of them was killed immediately and the other later succumbed to his wounds, police and paramedics said.

Palestinian media identified the attackers as Anan Abu Habsah and Issa Assaf, both 21, from Qalandiya.

Witnesses said one of the victims struggled with his stabber on the ground and was stabbed multiple times.

“Two people were struggling and at first I thought it was a game,” Yael, an eyewitness, told Israel Radio. “I saw [the attacker] trying to stab [his victim] with all his might.

“I saw the victim try to get away from him, but he couldn’t,” she added.

A video uploaded to YouTube by the Haaretz daily after the stabbing appeared to show bystanders beating the injured terror suspects lying prone on the ground.

In the video, one Jewish man is seen kicking something, likely one of the Palestinian terrorists.

Police said Wednesday night that the stabber, despite been shot, continued to wave a knife and threaten passersby, prompting the Israeli bystander to attack him with a pole.

The Israeli later gave testimony of the incident to police.

The Old City of Jerusalem has seen multiple stabbing attacks against Israeli civilians and security personnel in recent months, although most have been around the Damascus Gate, the main entrance to the Old City’s Muslim Quarter.