Israel removed metal detectors from a highly sensitive Jerusalem holy site in the pre-dawn hours of Tuesday and said they would no longer be used after the new security measures set off deadly violence.
The move came after intensive international diplomacy seeking to stop the outbreak of wider unrest, with warnings that it could spread far beyond Israel and the Palestinian territories.
A work crew could be seen in the early hours of Tuesday removing the metal detectors at one entrance, an AFP journalist reported.
Muslim officials said all had been dismantled.
Israel's security cabinet accepted "the recommendation of all the security bodies to change the inspection with metal detectors to a security inspection based on advanced technologies and other means," a statement from Prime Minister Benjamin Netanyahu's office said.
As word spread of the decision, a few hundred Palestinians gathered to celebrate near an entrance to the Haram al-Sharif mosque compound, known to Jews as the Temple Mount.
One person set off a firework, prompting Israeli police to raid and disperse them using sound grenades.
Details of the advanced technologies the cabinet spoke of were not clear, though cameras were installed at entrances to the site this week.
It was also not clear whether they would be accepted by Muslim worshippers.
"This movement is a movement of the street," said Sheikh Raed Dana of the Islamic Waqf organisation, which administers the holy compound.
"We as the Waqf listen to the street. The street says yes and we say yes; if the street says no to the measures, we will say no."
Israel installed metal detectors at entrances to the site, which includes the Al-Aqsa mosque and the Dome of the Rock, after an attack on July 14 that killed two policemen.
Palestinians viewed the new security measures as Israel asserting further control over the site. They refused to enter the compound in protest and prayed in the streets outside instead.
Israeli authorities said the metal detectors were needed because the July 14 attackers smuggled guns into the site and emerged from it to shoot the officers.
Clashes have broken out during protests over the measures, leaving five Palestinians dead.
Three Israelis were also killed when a Palestinian sneaked into a house in a West Bank settlement and stabbed them.
The decision to remove the metal detectors follows talks between Netanyahu and Jordan's King Abdullah II.
Jordan is the official custodian of Muslim holy sites in Jerusalem.
It also comes after one of US President Donald Trump's top aides, Jason Greenblatt, arrived in Israel for talks over the crisis and with the UN Middle East envoy warning of a further escalation.
"It is extremely important that a solution to the current crisis be found by Friday this week," the envoy, Nickolay Mladenov, said after briefing the UN Security Council, which met to discuss how to defuse the tension on Monday.
"The dangers on the ground will escalate if we go through another cycle of Friday prayer without a resolution to this current crisis," he said, warning that violence there could spread "beyond the Middle East itself".
- Rallying cry --
There was speculation that a separate diplomatic standoff may have helped push negotiations to remove the metal detectors along.
On Sunday night in Amman, an Israeli embassy security guard shot dead a Jordanian who attacked him with a screwdriver, according to Israeli officials.
A second Jordanian was also killed, apparently by accident.
Jordan insisted on questioning the security guard, while Israel said he had diplomatic immunity.
The guard arrived back in Israel late Monday along with other embassy staff, apparently after an agreement was brokered.
During discussions with Netanyahu, Abdullah had demanded that Israel remove the metal detectors.
Friday's main weekly Muslim prayers -- which typically draw thousands to Al-Aqsa -- had brought the situation to a boil.
Clashes erupted between Israeli security forces and Palestinians around the Old City, elsewhere in annexed east Jerusalem and in the occupied West Bank, leaving three Palestinians dead.
They continued on Saturday, leaving two more Palestinians dead.
Friday evening also saw a Palestinian break into a home in a Jewish settlement in the West Bank during a Sabbath dinner and stab four Israelis, killing three.
The Israeli army said the 19-year-old Palestinian had spoken in a Facebook post of the holy site and of dying as a martyr.
The holy site in Jerusalem has served as a rallying cry for Palestinians.
In 2000, then Israeli opposition leader Ariel Sharon's visit to the compound helped ignite the second Palestinian intifada, or uprising, which lasted more than four years.
It is in east Jerusalem, seized by Israel in the 1967 Six-Day War and later annexed in a move never recognised by the international community.
Considered the third holiest site in Islam, it is the most sacred for Jews. (**)