JERUSALEM  — Clashes erupted Thursday at a sacred shrine in Jerusalem as thousands of Muslims rushed to pray at the site for the first time in nearly two weeks following Israel’s removal of security devices installed there after a deadly attack.

Israeli police fired tear gas and rubber bullets as Palestinians threw stones inside the walled compound that is holy to both Muslims and Jews.

Muslims call the site the Noble Sanctuary, and it is the home of the Al-Aqsa Mosque, and is considered the third holiest place in Islam, after Mecca and Medina. Muslims believe the site marks the spot where the Prophet Muhammad ascended to heaven.

Jews also 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 Palestinian Red Crescent said 37 Palestinians were wounded, including some by rubber bullets and beatings. It said several people suffered broken bones.

The new violence came shortly after worshipers rushed to pray at the mosque that was reopened following an 11-day Muslim prayer boycott over the Israeli security measures.

Israeli police say the police responded after stones were thrown at officers at the gates to the site. The Red Crescent said tensions arose when Israeli troops closed one of the gates to the compound as large numbers of worshippers tried to enter.

The shrine had been at the center of an Israeli-Palestinian standoff over recent Israeli security installations at the site. Israel has since removed the devices.

The Temple Mount is one of several sites in the Holy Land governed by what is known as the “Status Quo,” an arrangement guaranteed by the Ottoman government in the 18th and 19th centuries laying out who controls aspects of seven sites in Jerusalem and two sites in Bethlehem.

RELATED: Christian leaders worry about Status Quo in Jerusalem

Seven of these sites are Christian, and responsibility is shared between different Churches, and two – the Western Wall/Noble Sanctuary in Jerusalem, and Rachel’s Tomb in Bethlehem – are shared between Jews and Muslims.

Under the Status Quo, even the smallest change to any site must be approved by all the involved parties, and the unilateral installation of metal detectors could be seen as violating the principle.

Palestinians had been praying in Jerusalem’s streets outside the shrine in the Old City to protest the security measures since the July 14 attack.

Israel installed the new security measures at the Jerusalem shrine after Palestinian gunmen shot and killed two police officers from within the site.

Israel said the security measures at the Jerusalem shrine were needed to prevent more attacks and were standard procedure around the world. Palestinians claimed Israel was trying to expand its control over the site, which Israel denied.

RELATED: Pope Francis calls for “moderation and dialogue” in Jerusalem crisis

Once Israel removed metal detectors and cameras Thursday, Muslim leaders told the faithful to return to pray at the Al-Aqsa Mosque in the compound. Droves of Palestinians entered for afternoon prayers, some waving national flags.

“After extensive discussion and after achieving this victory in this round we call on our people in Jerusalem and inside (Israel) and anyone who can access the Al-Aqsa Mosque to enter … en masse,” the Islamic leaders said in a statement.

Abdel Azim Salhab of the Waqf, Jordan’s religious body that administers the site, had urged imams to close other Jerusalem mosques Friday so worshipers will pray only at the Al-Aqsa Mosque.

Friday prayers are the highlight of the Muslim religious week. Thousands of Muslims typically worship at the holy compound in Jerusalem’s Old City.

Salhab said all devices had been removed from the entrances but he didn’t know if security cameras that had been mounted on the wall of the compound were also dismantled. He said if they are there, then “we reject it.”

On Tuesday, during a meeting of the United Nations Security Council, Monsignor Simon Kassas – the Chargé d’Affaires of the Vatican’s mission to the United Nations –  said Jerusalem needs an “internationally guaranteed” special status, in order to ensure the freedom of religion of the city’s inhabitants, “as well as the secure, free and unhindered access to the Holy Places by the faithful of all religions and nationalities.”

RELATED: Vatican: Jerusalem needs “internationally guaranteed” special status

Meanwhile, the Italian newspaper La Stampa reported that the Palestinian ambassador to the Vatican, Issa Kassissieh, met on Tuesday with Archbishop Paul Gallagher, the Vatican’s foreign minister. The newspaper reports that Gallagher assured the ambassador of the Vatican’s support for preservation of the Status Quo of the holy sites in Jerusalem.

King Abdullah of Jordan — recognized as the Muslim custodian of the shrine — urged Israel to “respect the historical and legal situation in the holy shrine to prevent the recurrence of these crises.”

Abdullah also issued blistering criticism of Israel’s handling of a deadly altercation at its embassy in Amman involving an Israeli security guard, calling Israeli Prime Minister Benjamin Netanyahu’s conduct “provocative.”

He blasted Netanyahu for hugging an Israeli security guard who killed two Jordanians at the Israeli Embassy in Amman over the weekend after a 16-year-old attacked the guard with a screwdriver.

“Such unacceptable and provocative behavior at all levels infuriates all of us, leads to insecurity and fuels extremism in the region,” Abdullah said in a statement.

The embassy incident has inflamed public opinion in Jordan, where a 1994 peace treaty with Israel remains deeply unpopular.

Netanyahu praised the guard upon his return, saying he had acted “calmly.”

Abdullah told senior officials that Netanyahu needs to take legal measures that “guarantee the trial of the murderer.”

He said the incident “will have a direct impact on the nature of our relations.”

The crisis in Jerusalem has highlighted the deep distrust between Israel and the Palestinians over the holy site.

Netanyahu is trying to halt a wave of unrest while not appearing to his hard-line base as capitulating.

A senior member of Netanyahu’s coalition government criticized Israel’s dismantling of the security devices, saying it could bring more violence.

Naftali Bennett, leader of the Jewish Home party, told Army Radio that “every time the state of Israel folds in a strategic way, we get hit with an Intifada. You seemingly benefit in the short term, but in the long term you harm deterrence.”

The Islamic militant group that rules Gaza praised the move. Izzat Risheq, a senior Hamas leader, tweeted that Palestinians achieved a “historic victory.”

“Today, our people celebrate the removal of the gates (security measures), tomorrow they will celebrate the removal of the occupation itself,” he said.

Crux staff contributed to this report.