UNITED NATIONS (AP) — The U.N. Mideast envoy said Tuesday that Israel and Hamas were "minutes away" from another "devastating confrontation" in Gaza on Saturday — a clash averted after U.N. and Egyptian diplomatic efforts got both sides to "step back from the brink."

Nikolay Mladenov warned that "unless we begin in earnest the crucial work required to change the current deteriorating dynamics, another explosion is almost a certainty."

He told the Security that he just returned from Gaza and "the situation is calming down although tensions remain," warning that he still "perilous" faceoff could lead to the fourth war in a decade between Hamas and Israel.

"Only through the repeated, collective efforts of all sides has another catastrophic escalation been averted over the past weeks," Mladenov said.

The latest outbursts of violence followed months of near-weekly border protests organized by Gaza's Hamas rulers. Over 130 Palestinians have been killed by Israeli gunfire since the protests began March 30.

The protests were aimed at ending the Israeli-Egyptian blockade of Gaza that has brought severe economic hardship to the territory and demanding a "right of return" for descendants of Palestinian refugees to ancestral homes in what is now Israel. More than 700,000 Palestinians were expelled or fled during the 1948 Mideast war over Israel's creation, and two-thirds of Gaza's 2 million residents are descendants of refugees.

Israel says it is defending its sovereign border and accuses Hamas of using the protests as a cover for attempts to breach the border fence and attack Israeli civilians and soldiers.

Israel's U.N. ambassador, Danny Danon, said flaming kites sent across the border by Hamas have destroyed over 7,400 acres — "that is half the size of Manhattan."

He said it is time that the Security Council declares Hamas a terrorist organization like al-Qaida and the Islamic State group, saying it is "holding hostage the entire population of Gaza" and its goal is to destroy Israel.

Danon again urged Hamas to release two Israeli civilians and the bodies of two soldiers. "One cannot demand humanitarian assistance to Gaza, which we support, while refusing to ensure the basic humanitarian rights of returning our captives and our fallen," he said.

Palestinian Ambassador Riyad Mansour said the "dire humanitarian situation has placed an explosive pressure on the infrastructure and caused loss of livelihood among the entire population of the Gaza Strip."

He accused Israel of persisting "with its willful killing of Palestinian civilians and disregard of human life," and said it is "imperative" that international protection be provided for Gaza's civilian population.

Mansour said it is also imperative to mobilize funds for the U.N. agency for Palestinian refugees, known as UNRWA, "given its vital role in Gaza and beyond."

UNRWA is facing a funding crisis following the Trump administration's decision to cut some $300 million to the agency this year. It is now reviewing some $200 million in assistance for the Palestinians.

U.S. Ambassador Nikki Haley made no mention of the cuts to UNRWA in her speech, which accused Arab and Islamic nations of being generous with their words in support of the Palestinians but not opening their wallets.

She said Iran, Algeria and Tunisia gave nothing to UNRWA last year and Pakistan and Egypt gave just $20,000. While Turkey gave $6.7 million, Kuwait $9 million and the United Arab Emirates $12.8 million, she said the United States gave $364 million to UNRWA last year — plus an additional $300 million to the Palestinians in bilateral aid.

Since 1993, Haley said, the United States has provided over $6 billion in assistance to Palestinians.

"How much have the Arab countries — some of whom are wealthy countries — how much have they given to the Palestinians?" Haley asked. "It does not come anywhere close to what the United States has done."

Saudi Arabia's ambassador, Abdallah Al-Mouallimi, had a sharp reply, though he didn't mention the United States, which is a close ally.

He said Saudi Arabia gave $100 million to UNRWA over the past year, $1 billion to UNRWA over the last two decades, "and more than $6 billion, with a B, to the Palestinian people over the last two decades in the form of humanitarian development."

"Saudi Arabia strongly believes in actions, not words," Al-Mouallimi said.

Israel also drew sharp criticism at the council's monthly Mideast meeting from many countries over last week's approval by its parliament of a bill defining it as the nation-state of the Jewish people.

Mansour, the Palestinian ambassador, said the new law "has transformed a situation of de facto apartheid into a situation of apartheid by law."

Deputy Iranian ambassador Eshagh Al Habib said the law means the legalization of "racism and apartheid, and ultimately, it means legitimizing exclusion, segregation and systemic inequality."

He recalled the General Assembly's 1975 resolution calling Zionism "a form of racism and racial discrimination" that was revoked in 1991. Nearly 30 years later, Al Habib said, "it is crystal clear that by doing so, the U.N. General Assembly has only emboldened Israel to legalize racism."