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)

JERUSALEM (AP) — Prayers at the Al-Aqsa Mosque ended peacefully on Friday amid two weeks of unrest over security devices at the 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 sacred Jerusalem compound on July 14, prompting Israel to install security devices at entrances to the site that is holy to both Muslims and Jews.

ADVERTISEMENT

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 meant to prevent more attacks and pointed to similar measures at sensitive sites around the world.

Five Palestinians have died in the past week and scores were wounded in violent clashes with Israeli security forces over the holy site.

ADVERTISEMENT

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 earlier this week. 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.

Jordan’s attorney general on Friday filed murder charges against the guard and hundreds of Jordanians marched in Amman, chanting, “Death to Israel.”

Israel’s foreign ministry said Friday night it is probing the incident and will update Jordan on developments.

Netanyahu has been trying to halt the unrest while not appearing to his hard-line base as caving into Arab demands. He has been criticized by nationalist members of his coalition government who accused him of capitulation.

In Gaza, which is run by the militant Hamas group, the Health Ministry said a Palestinian teen was killed in clashes Friday with Israeli soldiers stationed near the strip’s border fence with Israel. It said the 16-year-old was killed while protesting tensions in Jerusalem.

There were several such protests Friday in the Gaza Strip. The Israeli military said Palestinians threw rocks and rolled burning tires at them. It said troops opened fire when “main instigators” ignored warnings to stop damaging the security barrier.

In the violence in the West Bank, a Palestinian was shot and killed after he brandished a knife and ran 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 sneaked into a Jewish settlement in the West Bank and broke into 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 baby in the family.

Israel has been coping with a wave of Palestinian violence that began in 2015 over tensions at the holy site 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 Israeli targeting civilians and soldiers. During that same period, Israeli forces have killed more than 256 Palestinians; Israel has said that most of them were attackers, others died in clashes.

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 the attacks stem from anger and frustration at decades of Israeli rule in territories they claim for a state.