Muslim prayers at a major Jerusalem shrine have ended peacefully following tensions over security measures by Israeli forces, although violence continued in the West Bank where a Palestinian was killed after attacking soldiers.

Israeli forces are on high alert following two weeks of violence over the sacred site, which is holy to both Muslims and Jews.

Tensions flared at the site after Arab gunmen killed two police officers there on July 14, prompting Israel to install security devices at entrances.

The move outraged Muslims and sparked some of the worst street clashes in years, threatening to draw Israel into conflict with other Arab and Muslim nations.

Firas Dibs, an official from the Jordanian religious body which administers the sacred site, said tens of thousands attended Friday prayers.

Police spokesman Micky Rosenfeld said prayers at the Jerusalem shrine ended without incident. There were some sporadic low-level scuffles between Palestinians and Israeli forces nearby, but nothing on the scale of recent violence.

A Palestinian was later shot and killed after he ran towards troops armed with a knife in the West Bank, Israel’s military said.

No soldiers were injured in the incident at the Gush Etzion Junction, a busy intersection south of Jerusalem which has been the site of multiple Palestinian attacks over the past two years.

Palestinians threw fire bombs, rocks and rolled burning tyres at soldiers who responded with tear gas and rubber bullets at several protests in the West Bank.

Last Friday, a Palestinian infiltrated a Jewish settlement in the West Bank and entered a home where he stabbed three people to death and wounded a fourth as they ate the traditional Sabbath meal and celebrated the arrival of a new addition to the family.

Police had barred men under 50 from the Jerusalem site and braced for violence following security assessments which indicated Palestinians had planned protests there. There were no restrictions on women.

Muslims only returned to the site on Thursday after nearly two weeks of praying in the streets nearby in protest over the new Israeli security measures.

Metal detectors and cameras were put in place at entrances to the holy compound.

Muslims claimed Israel was trying to expand its control over the site.

Israel denied the allegations, insisting the measures were needed to prevent more attacks and were standard procedure at sites around the world.

Four Palestinians have died in the past week and scores were injured in violent clashes with Israeli security forces over the site.

The fate of the shrine is an emotional issue at the heart of the Israeli-Palestinian conflict. Even the smallest perceived change to delicate arrangements there sparks tensions.

Under intense pressure, Israel removed the metal detectors this week and said it planned to install sophisticated security cameras instead.

Jews revere the hilltop compound as the Temple Mount, the site of the two Jewish biblical temples. It is the holiest site in Judaism and the nearby Western Wall, a remnant of one of the temples, is the holiest place where Jews can pray.

The walled compound is home to the Al-Aqsa Mosque and the Dome of the Rock. It is Islam’s third-holiest site after Mecca and Medina in Saudi Arabia.

Muslims believe the site marks the spot where the Prophet Muhammad ascended to heaven.

Israel has been coping with a wave of Palestinian violence that erupted in 2015 over tensions at the Jerusalem holy site. Attacks at times were a daily occurrence.

Since then, Palestinians have killed 48 Israelis, two visiting Americans and a British tourist in stabbings, shootings and car-ramming attacks targeting civilians and soldiers.

In that time, Israeli forces killed more than 256 Palestinians, most said by Israel to be attackers.

Israel blames the violence on incitement by Palestinian religious and political leaders, compounded on social media sites that glorify violence and encourage attacks.

Palestinians say attacks stems from anger and frustration at decades of Israeli rule in territories they claim for a state.