Security officials said the weapons had been stashed in the holy building by Islamist militant group Hamas, which was ousted from the governing coalition following its violent takeover of the Gaza Strip in June.
The president's Fatah movement, which is taking extensive measures to ensure the coup does not spread to the West Bank, has accused Hamas of religious contempt during Ramadan, the most important month of the Islamic calendar, which starts today and runs until October 12.
Hamas officials denied the allegations, and said the weapons had been planted by security officials as a pretext for their attacks on mosques.
"Performances like this are easy to stage. All they need is to bring a few guns previously taken from their own storehouses, hide them in any part of a mosque, and let journalists film the silly drama", local media cited a Hamas member as saying.
The accusations against Hamas were echoed by the Palestinian Ministry for Religious Affairs, subordinate to Prime Minister Salam Fayyad. The ministry said it would work in close cooperation with the security forces to prevent the mosques from becoming caught up in political struggles.