TOKYO (AP) — Top diplomats from the Group of Seven leading industrial democracies announced a unified stance on the Israel-Hamas war on Wednesday after intensive meetings in Tokyo, condemning Hamas, supporting Israel’s right to self-defense and calling for “humanitarian pauses” to speed aid to desperate civilians in the Gaza Strip.

In a statement following two days of talks, the nations sought to balance unequivocal criticism of Hamas’ attacks against Israel and “the need for urgent action” to help civilians in the besieged Palestinian enclave.

“All parties must allow unimpeded humanitarian support for civilians, including food, water, medical care, fuel and shelter, and access for humanitarian workers,” said the statement, hammered out by U.S. Secretary of State Antony Blinken and foreign ministers from Britain, Canada, France, Germany, Japan and Italy. “We support humanitarian pauses and corridors to facilitate urgently needed assistance, civilian movement and the release of hostages.”

The G7 meeting was, in part, an attempt to contain the worsening humanitarian crisis while also keeping broader differences on Gaza from deepening. It came “at a very intense time for our countries and for the world,” Blinken said in remarks to reporters, adding that “G7 unity is stronger and more important than ever.”

The ministers noted that the G7 is “working intensively to prevent the conflict from escalating further and spreading more widely,” and also using sanctions and other measures “to deny Hamas the ability to raise and use funds to carry out atrocities.” They also condemned “the rise in extremist settler violence committed against Palestinians,” which they said is “unacceptable, undermines security in the West Bank, and threatens prospects for a lasting peace.”

As the diplomats met in downtown Tokyo, a U.N. agency said that thousands of Palestinians in Gaza are fleeing south on foot with only what they can carry after running out of food and water in the north. Israel said its troops were battling Hamas militants deep inside Gaza City, which was home to some 650,000 people before the war and where the Israel military says Hamas has its central command and a vast labyrinth of tunnels. The growing numbers making their way south point to an increasingly desperate situation in and around Gaza’s largest city, which has come under heavy Israeli bombardment.

“All of us want to end this conflict as soon as possible and meanwhile to minimize civilian suffering,” Blinken said. “But, as I discussed with my G7 colleagues, those calling for an immediate cease-fire have an obligation to explain how to address the unacceptable result that would likely bring about: Hamas left in place with more than 200 hostages, with a capacity and stated intent to repeat October 7th again and again and again.”

Looking ahead to after the war, Blinken said, “key elements should include no forcible displacement of Palestinians from Gaza. … No use of Gaza as a platform for terrorism or other violent attacks. No reoccupation of Gaza after the conflict ends. No attempt to blockade or besiege Gaza. No reduction in the territory of Gaza. We must also ensure no terrorist threats can emanate from the West Bank.”

Besides the monthlong conflict in Gaza, which followed Hamas’ Oct. 7 attack in Israel in which militants killed more than 1,400 people, mostly civilians, and took 242 hostage, the G7 envoys dealt with a flurry of other crises, including Russia’s war in Ukraine, North Korea’s nuclear and missile programs and China’s growing aggression in territorial disputes with its neighbors. There has also been a push for cooperation to combat pandemics, synthetic opioids, and threats from the misuse of artificial intelligence.

Since before Russia’s invasion of Ukraine, the G7 has held together in defense of the international order that originally emerged after the destruction of World War II. Despite some fraying around the edges, the group has preserved a unified front in condemning and opposing Russia’s invasion.

“Our steadfast commitment to supporting Ukraine’s fight for its independence, sovereignty, and territorial integrity will never waver,” the statement said.

Japanese Foreign Minister Yoko Kamikawa said the G7 foreign ministers “strongly condemned North Korea’s repeated ballistic missile launches as well as arms transfers from North Korea to Russia, which directly violate relevant U.N. Security Council resolutions.”

She stressed the need for G7 unity and cooperation in tackling global conflicts and tensions.

“G7 unity in the Indo-Pacific region is extremely important,” she said. “It is extremely important that G7 engages candidly with China and expresses our concerns directly to China and works together with China on global challenges and areas of common interest.”

Blinken has been pushing to significantly expand the amount of humanitarian aid being sent to Gaza, and getting Israel to agree to “pauses” in its military operation to allow that assistance to get in and more civilians to get out. Israel remains unconvinced and Arab and Muslim nations are demanding an immediate full cease-fire, something the United States opposes. There has also been resistance to discussing Gaza’s future, with the Arab states insisting that the immediate humanitarian crisis must be addressed first.

There have been some small cracks in the G7 over Gaza, which has inflamed international public opinion. Democracies are not immune from intense passions that have manifested themselves in massive pro-Palestinian and anti-Israel demonstrations in G7 capitals and elsewhere.

Last month in the U.N. Security Council, for instance, France voted in favor of a resolution calling for a humanitarian truce in Gaza that was vetoed by the United States because it didn’t go far enough in condemning Hamas’ attack on Israel which ignited the war. Britain and Japan abstained in that vote.

Blinken arrived in Tokyo from Turkey, the last stop on a four-day whirlwind tour of the Middle East that began with visits to Israel, Jordan, the West Bank, Cyprus and Iraq. From Japan, he will travel to South Korea and then on to India.