A lower Israeli court on Sunday overturned a police order barring three Jews from a contested Jerusalem holy site after they prayed there in violation of understandings with Muslim authorities, questioning the legal basis of such enforcement.

Al Aqsa mosque compound in Jerusalem's Old City, which Jews revere as a vestige of their two ancient temples, has long been a flashpoint of Israeli-Palestinian tensions. Israel allows Jews to visit on condition they refrain from religious rites.

But with such visits increasing in number, including over the Muslim fasting month of Ramadan that coincided this year with the Jewish Passover festival, Palestinians have cried foul.

Palestinian President Mahmoud Abbas issued a statement calling Sunday's ruling "a grave assault against the historic status quo ... and a flagrant challenge to international law".

Jerusalem Magistrate's Court ruled in favour of three appellants who had been banned from the Old City for 15 days for prostrating themselves and intoning a core Jewish prayer at the compound. The ruling quoted police as saying those actions disrupted its officers' duties and threatened public order.

Removing the ban, Judge Zion Saharai said that, while he had no intention of interfering in law enforcement at the site, "the appellants' conduct does not raise worry of harm befalling national security, public safety or individual security".

Police had no comment. Eran Schwarz, a lawyer whose firm represented the appellants, said he expected police to contest the ruling. Magistrate's courts can be overturned by district courts, with Israel's Supreme Court a final course of appeal.

The ruling came a week before nationalist Jews are due to hold an annual flag march through Jerusalem's Old City, marking its capture by Israel in a 1967 Middle East war. The event is resented by Palestinians, who want the Old City and other parts of East Jerusalem as capital of their hoped-for future state.

Hamas, a Palestinian Islamist group that fought a Gaza war with Israel last year that was partly stoked by Jerusalem tensions, described the flag march's planned route through a Muslim quarter of the Old City as "adding fuel to the fire".

"I warn the enemy against carrying out such crimes," Hamas chief Ismail Haniyeh said in a televised address.

Jordan, a U.S.-backed Israeli security partner that serves as custodian of Al Aqsa, has also voiced concern about the Jewish visits to the compound.