Israel will remove metal detectors from entrances to the Temple Mount, after days of rioting by Palestinians furious at the installation of the devices in the wake of a deadly attack.

“The Security Cabinet accepted the recommendation of all of the security bodies to incorporate security measures based on advanced technologies (‘smart checks’) and other measures instead of metal detectors in order to ensure the security of visitors and worshippers in the Old City and on the Temple Mount,” said a government statement released late Monday night.

The statement said Israel will pay up to 100 million shekels (about $30 million) over the next six months to install the new devices.

The area around the Temple Mount, the holiest site in Judaism and also the location of the Haram A-Sharif, the third holiest site in Islam, has been riven with tensions since July 14 when three Arab-Israelis shot and killed two Israeli police officers at the holy site before they were shot to death.

Israeli authorities installed metal detectors at the site in the wake of the attack and since then, Muslims have refused to enter the Temple Mount, instead praying outside of its gates, leading to clashes and the deaths of at least five Palestinians in recent days.

The announcement came after days of intensive consultations between Prime Minister Benjamin Netanyahu, Jordanian King Abdullah, and the Trump administration, including President Donald Trump’s special envoy to the region, Jason Greenblatt, who flew in on Sunday to help calm the tensions.

===

The members of Israel’s diplomatic mission in Amman, Jordan, including a security guard who shot and killed his teenage assailant and a bystander, are back in Israel.

The embassy employees, who had been confined to the embassy compound all day Monday following the stabbing attack Sunday evening by a 17-year-old and subsequent shooting, returned late Monday through the Allenby Bridge.

In a statement issued shortly after 11 p.m. Monday, the Israeli Prime Minister’s Office said their return “was made possible by the close cooperation that took place in the last 24 hours between Israel and Jordan.”

The head of the Israel Security Agency, or Shin Bet, Nadav Argaman, traveled Monday to Jordan in an effort to diffuse the crisis.

Israeli Prime Minister Benjamin Netanyahu and Jordan’s King Abdullah spoke that afternoon by telephone. Abdullah told Netanyahu to remove the metal detectors placed at the entrances to the Temple Mount used by Muslim worshippers, put into place after three Arab-Israelis killed two Druze-Israeli police officers in a July 14 terrorist attack near the Al-Aqsa mosque.

Israel’s Security Cabinet met for several hours Monday evening in an effort to resolve the crisis over security measures on the Temple Mount and the escalating diplomatic crisis with Jordan.

In the attack Sunday, the assailant entered a residential building occupied by the embassy to install furniture and stabbed the Israeli guard with a screwdriver. The guard shot and killed the assailant. The building’s owner, who was standing nearby, was killed after being hit by a stray bullet.

Jordanian police had demanded to question the guard, while relatives of the stabber called for the death penalty. The embassy refused to turn the guard over to the Jordanians for questioning, saying he had immunity.

Jordanian security forces reportedly held mobs of protesters who had gathered at the embassy at bay following the incident.

The Israeli media reported that the government is considering removing the metal detectors and replacing them with high-tech security cameras, and is aiming to make the changes before Friday, the busiest day at the site for Muslim prayers.

The cameras reportedly would be located a distance away from the gates into the site, so as not to offend the worshippers, who have been protesting the metal detectors by refusing to enter the sites and holding worship services at the gates, leading to clashes with Israeli security forces that have killed at least five Muslims.