JERUSALEM - Palestinian foreign minister Riyad al-Maliki said Saturday the Palestinians have petitioned the UN's top court, alleging that the US inauguration of an embassy in Jerusalem was illegal.

The Palestinians have filed a lawsuit at the International Court of Justice (ICJ) "for violating international law by moving its embassy in Israel to the occupied city of Jerusalem", he said, quoted by the official Palestinian news agency WAFA.

In December, US President Donald Trump recognised Jerusalem as the capital of Israel, despite Palestinian claims on part of the city and breaking with longstanding US policy. Palestinians have since refused all contact with the Trump administration.

The US embassy was transferred from Tel Aviv to Jerusalem on May 14, a day marked by mass protest in the Gaza Strip, where about 60 Palestinian protesters were killed by Israeli fire in border clashes.

Israel occupied east Jerusalem along with the West Bank in the 1967 Six-Day War and later declared the entire city its united capital.

Palestinians claim the predominantly Arab eastern area as the capital of a future Palestinian state.

UN resolutions call on countries to refrain from moving their embassies to the city until its status is resolved in an Israeli-Palestinian deal.

"The ICJ was asked to declare that moving the embassy to occupied Jerusalem constituted a violation of the Vienna Convention on Diplomatic Relations," WAFA wrote in English.

The court said the Palestinian suit, filed on Friday, asked the body "to order the United States of America to withdraw the diplomatic mission from the Holy City of Jerusalem and to conform to the international obligations flowing from the Vienna Convention".

UN calls on Israel and Hamas to prevent further deaths

The UN called Saturday for Israel and Hamas rulers to rein in violence a day after border clashes in which the Gaza health ministry said seven Palestinians were killed.

"I am deeply saddened by reports that seven Palestinians, including two children, were killed, and hundreds of others injured, by Israeli forces during demonstrations in the Gaza Strip yesterday (Friday)," the UN's humanitarian coordinator for the Palestinian territories, Jamie McGoldrick, said in a statement.

"I call on Israel, Hamas and all other actors with the ability to influence the situation, to take action now to prevent further deterioration and loss of life."

Two boys aged 12 and 14, were among those killed in the clashes Friday, the bloodiest day of border protests since May 14, when more than 60 Palestinians died in violence accompanying the inauguration of the US embassy in Jerusalem, a move that enraged Palestinians.

The Israeli army said in a statement Saturday that some 20,000 "rioters and demonstrators" had gathered at multiple sites along the Gaza-Israel border and that people had hurled "over 100" grenades and explosive devices at troops and the at the border fence.

The military said troops fired "in accordance with standard operating procedures" and that Israeli aircraft also struck two positions belonging Gaza's Islamist rulers Hamas.

"Hamas is responsible for the violent riots and their consequences," it said.

It declined to comment directly on Friday's reported deaths. Palestinians have been protesting almost weekly along the Gaza border since March 30 in what they call the "Great March of Return".

At least 193 Palestinians have been killed by Israeli fire since then, the majority during border protests, while one Israeli soldier has been shot dead by a Palestinian sniper. "I call on Israeli forces to ensure that their use of force is in line with their obligations under international law," McGoldrick said.

"All actors must ensure that children never be the target of violence and neither be put at risk of violence, nor encouraged to participate in violence."

In Saturday's statement the Israeli army said Hamas was "endangering children by sending them to the security fence as a cover for terror activity".