JERUSALEM (Reuters) - Israeli authorities said four Palestinians had been shot dead and a fifth seriously injured in thwarted knife attacks on Saturday in Jerusalem and the occupied West Bank as tensions ran high after more than two weeks of unrest.

A Palestinian protester runs during clashes with the Israeli troops near the Jewish settlement of Beit El, near the West Bank city of Ramallah, October 15, 2015. REUTERS/Mohamad Torokman

Forty-one Palestinians and seven Israelis have died in the recent street violence, which was in part triggered by Palestinians’ anger over what they see as increased Jewish encroachment on Jerusalem’s al-Aqsa mosque compound.

Israel says it is keeping the status quo at the holy compound, which is also revered by Jews as the location of two destroyed biblical Jewish temples.

The Palestinian dead include attackers wielding knives and protesters shot by Israeli forces as they threw rocks. The Israelis were killed in random attacks in the street or on buses.

In the latest attack, a Palestinian stabbed and wounded an Israeli border policeman at the Qalandia crossing in the West Bank, a police spokesman said. The attacker was initially shot and wounded in the leg.

During a follow-up body search, the attacker drew a second knife and tried to stab another officer, after which he was shot dead, the spokesman said.

In East Jerusalem and Hebron, two Palestinians who also attempted knife attacks were killed and another was seriously wounded, Israeli authorities said. One Israeli border policewoman was lightly wounded.

A fourth Palestinian was shot dead, also in Hebron, but there were conflicting reports about the incident.

Israel’s military said the Palestinian attempted to stab an Israeli civilian, who was carrying a gun and shot the attacker dead. A Palestinian man told Reuters that his daughter, a high school student, had seen the shooting and said it happened when Jewish settlers attacked an unarmed Palestinian.

There has also been violence along the Gaza-Israel border. Israel’s army defused a rocket that it said had been fired by Gaza militants overnight and landed in an open area.

Peace talks collapsed in 2014 over Israeli settlement-building in the occupied West Bank and East Jerusalem, areas that the Palestinians seek for a state, and after Palestinian President Mahmoud Abbas angered Israel by reaching a unity deal with the Islamist group Hamas in Gaza.

The last major armed confrontation was the Gaza conflict between Israel and Hamas in 2014, which left large sections of Gaza destroyed. Around 2,100 Palestinians, most of them civilians, and 73 Israelis, most of them soldiers, were killed.

The United States has stepped up efforts to try to restore calm. Secretary of State John Kerry spoke by phone with both Israeli Prime Minister Benjamin Netanyahu and Abbas to discuss ways to end the violence.

Kerry and Netanyahu are due to meet next week in Germany.