Palestinians pray outside the Damascus Gate in 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. (AP Photo/Tsafrir Abayov)
Palestinians pray outside the Damascus Gate in 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. (AP Photo/Tsafrir Abayov) Credit: Tsafrir Abayov

Prayers at the Al-Aqsa Mosque ended peacefully on 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 and another died in clashes along Gaza’s border with Israel.

Tensions have been high since Arab gunmen killed two police officers in the Jerusalem compound on 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, threatening 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.

By nightfall Friday, Jordan’s religious body that administers the Jerusalem site said the situation at the compound had returned to what it was before the July 14 attack – a key Palestinian demand for protests to end. The Waqf said “all doors are opened in front of worshippers without restrictions or conditions,” adding that the development was a result of “pressure from the Jordanian government on the Israeli government.”

Firas Dibs, an official from Waqf, said earlier that 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 during the day and braced for violence following security assessments indicting Palestinians had planned protests there. There were no restrictions on women. Israeli police lifted the age restrictions and other measures Friday night.

Muslims only returned to the site on 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.

Five Palestinians have died in the past week and scores were wounded 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.

Jordan is the custodian of the Muslim shrine in Jerusalem and was involved in behind-the-scenes negotiations to end the latest escalation. But there has been growing outrage in the kingdom over the crisis at the shrine and over a deadly altercation at the Israeli Embassy compound in Amman. Jordan’s 1994 peace treaty with Israel remains deeply unpopular in the kingdom.

King Abdullah II of Jordan scolded Netanyahu’s handling of the incident, in which an Israeli guard shot and killed two people after he was attacked by one of them with a screwdriver.

Netanyahu praised the guard and gave him a warm personal welcome when he returned to Israel, following a diplomatic standoff this week.