JERUSALEM -- Israel began removing metal detectors from entrances to a major Jerusalem shrine early Tuesday morning to defuse a crisis over the site that angered the Muslim world and triggered some of the worst Israeli-Palestinian clashes in years.

The Israeli security Cabinet had met for a second straight day Monday to find an alternative to the metal detectors, which were installed following a deadly Palestinian attack at the holy site.

Photos from the scene show workers dismantling one of the devices early Tuesday.

Get Breaking News Delivered to Your Inbox

"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," Israel announced Tuesday.

It said the measure will "ensure the security of visitors and worshippers" at the holy site and in Jerusalem's Old City. It added that police will increase its forces in the area until the new security measures are in place.

Israeli media earlier reported high resolution cameras capable of detecting hidden objects would be deployed.

Israel erected the metal detectors after Arab gunmen killed two policemen from inside the shrine, holy to Muslims and Jews, earlier this month. The move incensed the Muslim world and triggered violence.

The fate of the site is an emotional issue at the heart of the conflict between Israel and the Palestinians. Even the smallest perceived change to delicate arrangements pertaining to the site sparks tensions.

Just a few hours earlier, Israel and Jordan resolved a diplomatic standoff late after a day of high-level negotiations that ended with the evacuation of Israeli Embassy staff from their base in Jordan to Israel.

On Friday, tensions over the shrine escalated into violence that killed six people -- three Palestinians in street clashes in Jerusalem and three Israelis in a stabbing attack at a West Bank settlement.

Palestinians react following tear gas that was shot by Israeli forces after Friday prayer on a street outside Jerusalem's Old city on July 21, 2017. Reuters

The crisis was resolved after a phone call late Monday between Israeli Prime Minister Benjamin Netanyahu and Jordan's King Abdullah II.

The relatively swift end to the standoff signaled progress toward ending the crisis over the contested Jerusalem holy shrine. Jordan is the Muslim custodian of the site which is also holy to Jews.

On Monday evening, the Israeli security Cabinet met for a second straight day to try find an alternative to metal detectors that had been installed a week earlier at the shrine amid widespread Muslim protests.

Ministers were being asked to consider the installation of sophisticated, high-resolution cameras and increased police deployments as a replacement for the metal detectors, Israeli media said. The cameras would be installed in Jerusalem's Old City where the shrine is located.

Media reports had said the emerging deal could see the embassy security guard released in exchange for the removal of the metal detectors.

The 37-acre walled compound in Jerusalem is the third holiest site of Islam, after Mecca and Medina in Saudi Arabia. It is also the holiest site of Judaism, revered as the place where biblical Temples once stood.

Netanyahu and Jordan's king discuss the shrine in their phone call, Jordan's state news agency Petra said.

The king stressed the need to "remove the measures taken by the Israeli side since the recent crisis broke out" and to agree on steps that would prevent another escalation in the future, Petra said.

Earlier, the head of Israel's domestic Shin Bet security agency had met with officials in Jordan to resolve the crisis, the worst between the two countries in recent years. Jordan and Israel have a peace agreement and share security interests, but frequently disagree over policies at the shrine.

Netanyahu's office said the Israeli-Jordanian contacts were conducted in an atmosphere of cooperation.

As part of intensifying diplomatic efforts, President Trump's Mideast envoy, Jason Greenblatt, met with Netanyahu in Jerusalem on Monday. It was a high-level, on-the-ground attempt by the Trump administration to end the standoff between Israel and the Muslim world.

"I thank President Trump for directing Jared Kushner and dispatching Jason Greenblatt to help with our efforts to bring the Israeli embassy staff home quickly. I thank King Abdullah as well for our close cooperation," said Netanyahu.

The escalation began earlier this month when Arab gunmen fired from the holy site, killing two Israeli policemen. In response, Israel installed metal detectors at the site, a move that incensed the Muslim world.

Palestinians pray in front of mock metal detectors during a demonstration in Bethlehem, on Sun., July 23, 2017. AP

Muslim leaders alleged Israel was trying to expand its control at the site under the guise of security, a claim Israel has emphaticlly denied. The tensions have led to mass prayer protests and deadly Israeli-Palestinian violence.

Palestinians clash with Israeli security forces outside Jerusalem's Old city on July 21, 2017. Reuters

Israel has said the metal detectors are a needed security measure to prevent future attacks.

At one of the gates to the shrine, Israel set up metal railings of the type typically used for crowd control, to create orderly lines.

A media report has suggested that such railings could be part of a compromise that would enable the removal of the metal detectors.

Netanyahu's government faced growing domestic criticism in recent days, with some commentators saying it made hasty decisions affecting the most volatile spot of the Israel-Palestinian conflict.

At the United Nations, Mideast envoy Nikolay Mladenov warned of an escalation if the crisis over the metal detectors isn't resolved by the time of Muslim prayers Friday.

He told reporters after briefing the U.N. Security Council behind closed doors Monday that it is "critically important" that the status quo which has been in place at the site since 1967 is preserved.

Israel captured the shrine, along with east Jerusalem and other territories, in the 1967 war. Since then, Muslims have administered the shrine, with Jews allowed to visit, but not to pray there.

Meanwhile, Jordan's Public Security Directorate said it had concluded an investigation of the Israeli Embassy shooting which took place Sunday evening in a residential building used by embassy staff.

The security agency said the incident began when two Jordanians arrived at the building to set up bedroom furniture, including the son of the owner the furniture store, later identified as 17-year-old Mohammed Jawawdeh.

It said a verbal dispute erupted between the son of the owner and the embassy employee because of a delay in delivering the furniture. The argument took place in the presence of the landlord and a doorman, the agency said.

"The son of the owner attacked the Israeli diplomat and injured him," the statement said. It said the Israeli fired toward the teen, injuring him, and also struck the landlord who was standing nearby.

The two Jordanians died of their injuries at a hospital.

Earlier Monday, al-Jawawdeh's father, Zakariah, had called for an investigation, saying his son deserves justice. It was not clear if the findings of the security agency will satisfy him.