The Palestinian was stopped by a neighbour, an off-duty Israeli soldier, who shot him, the official said.
Israel installed the detectors after three Palestinians launched an attack from the shrine a week ago, killing two Israeli policemen. "Three of the victims died as a result of their wounds, and another was evacuated to the hospital".
Palestinians have been refusing to enter the compound since then, and hundreds have been holding prayers outside, with clashes occasionally breaking out with Israeli police.
Palestinian president Mahmoud Abbas asked the U.S. to "intervene urgently" and compel Israel to remove the metal detectors.
Turkey's President Recep Tayyip Erdogan on Saturday condemned Israel's excessive use of force against Palestinians in East Jerusalem, urging an immediate end to its new restrictions at the Al-Aqsa Mosque compound.
The latest conflict is over Israeli metal detectors set up at a Jerusalem shrine.
Muslim men under the age of 50 were not allowed access on Friday to a contested Jerusalem holy site where the mosque is located, inside the Old City.
Egypt is extremely anxious about the disproportionate use of force by police against Palestinians in Jerusalem and around Al-Aqsa Mosque, according to a statement.
Israeli Police used tear gas and stun grenades to push back protesters near the shrine in Jerusalem's old city.
Thousands of believers refused to ascend the temple mount through the metal detector, spread out prayer mats in the streets and began to pray.
The dispute over the metal detectors has led to rising tensions between Israel and the Muslim world, with even friendly Arab nations, such as Jordan, appealing to Israel to remove the devices.
The holy compound includes the Al-Aqsa mosque and the Dome of the Rock.
Israel asserts there is no change to the status quo and that the metal detectors are necessary to stop further attacks.
An Israeli official confirmed to Fox News that "Israeli Prime Minister Benjamin Netanyahu held security consultations this (Wednesday) morning about the ongoing events and will continue these discussions later today".