Mahmoud Illean, Associated Press
A Palestinian man walks past Israeli police officers prior to prayers outside Jerusalem's Old City, Friday, July 28, 2017. Muslim prayers at a major Jerusalem shrine ended peacefully Israeli police said Friday but violence continued in the West Bank where a Palestinian was killed attacking soldiers as forces were on high alert following two weeks of violence over the sacred site, holy to both Muslims and Jews.

JERUSALEM — Prayers at the Al-Aqsa Mosque ended peacefully Friday amid two weeks of unrest over security at a major holy site in Jerusalem, Israeli police said, but violence flared in the West Bank, where a Palestinian was killed after he attacked soldiers.

Tensions have been high since Arab gunmen killed two police officers in the compound July 14, prompting Israel to install security devices at entrances to the site that is sacred to both Muslims and Jews.

The move outraged Muslims and sparked some of the worst street clashes in years and threatened to draw Israel into conflict with other Arab and Muslim nations. Under intense pressure, Israel removed the metal detectors this week and said it planned to install sophisticated security cameras instead.

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

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

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

Muslims only returned to the site Thursday after about two weeks of praying in the streets nearby to protest the new security measures. They had claimed Israel was trying to expand its control over the site. Israel denied the allegations, insisting the measures were to prevent more attacks.

Four Palestinians have died in the past week and scores injured in violent clashes with Israeli security forces over the holy 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 can increase tensions.

Jews revere the hilltop compound as the Temple Mount, 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 both 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.

In the violence in the West Bank, a Palestinian was shot and killed after he brandished a knife at troops, Israel's military said. No soldiers were hurt in the incident at the Gush Etzion Junction, the military added.

The busy intersection south of Jerusalem has been the site of multiple Palestinian attacks in the past two years.

Palestinians threw firebombs and rocks, and rolled burning tires at soldiers who responded with tear gas and rubber bullets at several protests in the West Bank, the military said.

On July 21, 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.

Israel has been coping with a wave of Palestinian violence that began in 2015 over tensions at the holy sites in Jerusalem. 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 same period, 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. Palestinians say the attacks stem from anger and frustration at decades of Israeli rule in territories they claim for a state.