Three Palestinians have died in confrontations with Israeli forces over security measures at a major Jerusalem shrine.

The Palestinian Red Crescent said another 41 Palestinians were taken to hospitals or clinics with injures from live fire, rubber bullets and beatings while about 150 Palestinians were treated for tear gas inhalation.

Muslims say Israel’s decision to installed metal detectors, taken after a deadly Palestinian attack, is an attempt to encroach on Muslim rights at the site. Israel has denied the claim.

The Palestinian Health Ministry said a 17-year-old was one of those killed in the clashes.

Officials said 3,000 attended several protests over the detectors Israel placed near a site holy to both Jews and Muslims.

Palestinians rolled burning tyres and threw stones at forces who responded with tear gas and rubber bullets. The military said four officers were injured by stones and fireworks.

Thousands of Muslims earlier prayed in the streets near the contested shrine, known to Muslims as the Noble Sanctuary and to Jews as the Temple Mount.

The prayers largely ended peacefully, although in three areas near Jerusalem’s Old City, Israeli forces fired tear gas to disperse groups of stone-throwers.

The city’s top Muslim cleric, Mohammed Hussein, told worshippers he expects a “long test of wills” with Israel.

Israel also dug in, saying the devices would stay.

Israel installed the detectors after three Palestinians launched an attack from the shrine a week ago, killing two Israeli policemen. Police said the metal detectors are needed to prevent further attacks.

On Friday, police severely restricted access to the area of the Muslim-administered shrine, and set up checkpoints in and around Jerusalem to prevent widespread protests.

About 3,000 officers were deployed near the Old City, turning away Muslim men under the age of 50. Some worshippers who came from Israel and the West Bank were intercepted before reaching Jerusalem.

Israel’s military said thousands of Pales