Work crews removed advanced security cameras along with metal detectors installed outside the Temple Mount in Jerusalem overnight Monday, in a bid to defuse rampant tensions that have set Jerusalem and the West Bank aflame in recent days. New metal barriers, for channeling people toward the entrance gates, remained in place.

The security measures had been set up last week in the wake of a terror attack at the holy site on July 14 in which terrorists used guns smuggled into the compound to kill two police officers standing guard nearby.

The removal of the new security measures followed an Israeli security cabinet decision to replace the metal detectors with security measures based on “advanced technologies,” allocating some NIS 100 million ($28 million) over a six-month period for the plan.

Reports indicated that the new technologies were a new set of advanced cameras that could detect hidden objects to replace the ones that were taken down overnight.

While reports came out quickly about the metal detectors being taken down in the early hours of Tuesday morning, the removal of the much smaller cameras went unnoticed until after dawn.

The much more visible metal detectors had formed the focus of protests over the security measures that Muslims said were a violation of the delicate status quo at the holy site; some demonstrations in Jerusalem, the West Bank and elsewhere had seen mockups of metal detectors burned in a sign of anger over the installation of the gateways.

Police confirmed that the detectors had been removed, but the spokesperson said she could not yet comment on the cameras.

The scaffolding on which the cameras had been installed remained in place on Tuesday morning; only the cameras themselves had been removed.

It was not immediately clear what security measures would be used to screen Muslim worshipers entering the Temple Mount, beyond spot checks by the Border Police officers who were still standing guard at the site.

Spokespeople for the police and for the Prime Minister’s Office did not respond to a request for comment.

Palestinian media reported that there were still some Muslim worshipers refusing to enter the Temple Mount complex in protest of Israel’s actions at the entrance to the holy site.

Work crews could be seen in the early hours of Tuesday removing the metal detectors at one entrance. Earlier, heavy machinery and workers could be seen heading to the entrance of the site.

Muslim officials said all the metal detectors had been dismantled by the dawn hours.

The metal detectors were set up by Israel following a July 14 attack in which three Arab Israeli assailants killed two Israeli Druze officers just outside the Temple Mount, having stashed their weapons at the holy site shortly beforehand and having emerged from it to carry out the attack.

In a rare move, Israel shut the site on July 14-15 and re-opened it with new security arrangements in place.

Israeli security forces remove metal detectors at the Lions' Gate, near a main entrance to the Temple Mount in Jerusalem's Old City, on July 24, 2017. (AFP/ Ahmad GHARABLI)

Israeli security forces remove metal detectors at the Lions’ Gate, near a main entrance to the Temple Mount in Jerusalem’s Old City, on July 24, 2017. (AFP/ Ahmad GHARABLI)

The implementation of the measures set off daily unrest and clashes between Palestinian rioters and Israeli police in and around East Jerusalem and the West Bank, with the violence coming to a head over the weekend when three Israeli family members were murdered by a Palestinian terrorist who stabbed them to death at their Shabbat table in the West Bank settlement of Halamish on Friday, as others, including children, rushed to hide.

The 19-year-old terrorist had written a Facebook post prior to the attack that he would die as a martyr to defend the al-Aqsa mosque.

Five Palestinians were killed in clashes between rioters and police on Friday and Saturday.

The Prime Minister’s Office said early Tuesday that 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.”

As word spread of the decision, a few hundred Palestinians gathered to celebrate at Lions Gate, near an entrance to the Temple Mount. One person set off a firework, prompting Israeli police to disperse them.

Israeli security forces stand by as Palestinian Muslim worshippers pray outside Lions' Gate, near a main entrance to the Temple Mount in Jerusalem's Old City, on July 24, 2017. (AFP/ Ahmad GHARABLI)

Israeli security forces stand by as Palestinian Muslim worshippers pray outside Lions’ Gate, near a main entrance to the Temple Mount in Jerusalem’s Old City, on July 24, 2017. (AFP/ Ahmad GHARABLI)

The cabinet decision to remove the metal detectors came shortly after Israel and Jordan came to an agreement regarding the safe return of an Israeli security guard injured in a stabbing attack at the Israeli embassy in Amman on Sunday.

The incident caused a diplomatic flare-up between the two countries, as the guard killed his attacker and another Jordanian national. Jordanian authorities had initially sought to interrogate the guard over the incident, while Israel refused to hand him over, in what devolved into a tense standoff.

As part of intensifying diplomatic efforts, Israel sent Shin Bet chief Nadav Argaman to Amman, and US President Donald Trump’s Mideast envoy, Jason Greenblatt, met with Netanyahu in Jerusalem on Monday before traveling on to Amman.

In a statement Tuesday, Prime Minister Benjamin Netanyahu thanked US President Donald Trump for “directing [senior adviser and son-in-law] Jared Kushner and dispatching Jason Greenblatt to help with our efforts to bring the Israeli embassy staff home quickly. I thank King Abdullah [II] as well for our close cooperation.”

The guard and other Israeli embassy staff, including the ambassador, Einat Schlein, crossed from Jordan back into Israel late Monday.

In the hours before the embassy staff returned, Netanyahu spoke by phone with the Jordanian monarch who reportedly demanded the removal of the metal detectors at the Temple Mount, which houses the Al-Aqsa Mosque and the Dome of the Rock, and is administered by a Jordanian-controlled Islamic trust.

The Temple Mount is the holiest site in Judaism and is revered as the site of the biblical temples. It is also the third-holiest site in Islam, after Mecca and Medina, and is known to Muslims as the Haram al-Sharif. Under an arrangement in place since Israel emerged victorious in the Six Day War in 1967, non-Muslims are allowed access to the site but are forbidden to pray there. Under this status quo, Israel is responsible for security at the site while the Jordanian trust — the Waqf — is in charge of administrative duties.

Jordan had been highly critical of the placement of metal detectors at the site, as have the Palestinians, who alleged the security measures were a bid by Israel to assert control over the Temple Mount and thus a change to the status quo — a charge Israel has repeatedly denied.

The Prime Minister’s Office had earlier denied a Channel 2 report that Amman had demanded the metal detectors be removed as a condition for securing the passage of the Israeli security guard.