THE HAGUE, Netherlands — The United Nations' top court ordered Israel on Friday to immediately halt its military offensive in the southern Gaza city of Rafah, but stopped short of ordering a cease-fire for the enclave. Although Israel is unlikely to comply with the order, it will ratchet up the pressure on the increasingly isolated country.

Criticism of Israel's conduct in the war in Gaza has been growing, particularly since it turned its focus to Rafah. This week alone, three European countries announced they would recognize a Palestinian state, and the chief prosecutor for another international court requested arrest warrants for Israeli leaders, along with Hamas officials.

Israeli Prime Minister Benjamin Netanyahu is also under some pressure at home to end the war, which was triggered when Hamas-led militants stormed into Israel, killing 1,200 people, most civilians, and taking roughly 250 hostage. Thousands of Israelis have joined weekly demonstrations calling on the government to reach a deal to bring the hostages home, fearing time is running out.

''The charges of genocide brought by South Africa against Israel at the International Court of Justice in the Hague are false, outrageous and morally repugnant,'' Netanyahu's government said in response to the ruling. "Israel has not and will not conduct military actions in the Rafah area which may inflict on the Palestinian civilian population in Gaza conditions of life that could bring about its physical destruction in whole or in part.''

Israel doesn't accept the ICJ's jurisdiction, but South Africa was able to bring its case because both countries are signatories to the Genocide Convention that includes a clause allowing disputes about the convention to be settled by the ICJ.

Although the ruling is a blow to Israel's international standing, the court doesn't have a police force to enforce its orders. In another case on its docket, Russia has ignored the court's 2022 order to halt its full-scale invasion of Ukraine.

The sharply focused decision sent a three-pronged message to Israel, ordering a halt to the Rafah offensive, access to Gaza for war crimes investigators, and a big and immediate increase of humanitarian aid to the region, parts of which are enduring famine.

Rafah is in the southernmost part of the Gaza Strip, on the border with Egypt, and over 1 million people sought refuge there in recent months after fleeing fighting elsewhere, with many of them living in teeming tent camps. Israel has been vowing for months to invade Rafah, saying it was Hamas' last major stronghold, even as several allies warned that an all-out assault would spell disaster.

Israel started issuing evacuation orders about two weeks ago as it began operations on the edge of the city. Since then, the army says an estimated 1 million people have left as forces press deeper inside.

Rafah is also home to a critical crossing for aid, and the U.N. says the flow of aid reaching it has plunged since the incursion began, though commercial trucking has continued to enter Gaza.

The court ordered Israel to keep the Rafah crossing open, saying ''the humanitarian situation is now to be characterized as disastrous.''

''This legally binding and very specific ruling leaves Israel with very little wiggle room,'' said Reed Brody, a veteran human rights lawyer and prosecutor.

Benny Gantz, a popular centrist member of Netanyahu's war cabinet, appeared to indicate that Israel would not change its course regarding Rafah.

''The State of Israel is committed to continue fighting to return its hostages and promise the security of its citizens — wherever and whenever necessary — including in Rafah,'' he said.

"We will continue operating in accordance with international law wherever we might operate, while safeguarding to the best extent possible the civilian population. Not because of the ICJ, but because of who we are and the values we stand for.''

Balkees Jarrah, associate international justice director at Human Rights Watch, said the court's order underscored the perilous situation of Palestinians in Gaza, but warned that it could be ignored if the international community doesn't use whatever leverage it can on Israel.

''The ICJ's decision opens up the possibility for relief, but only if governments use their leverage, including through arms embargoes and targeted sanctions, to press Israel to urgently enforce the court's measures,'' Jarrah said.

The court's president, Nawaf Salam, read out the ruling as a small group of pro-Palestinian protesters demonstrated outside.

Fears the court expressed earlier this year about an operation in Rafah have ''materialized,'' the ruling said, and Israel must ''immediately halt its military offensive'' in the city and anything else that might result in conditions that could cause the ''physical destruction in whole or in part'' of Palestinians there.

But the ruling didn't call for a full cease-fire throughout Gaza, as South Africa, which has historic ties to the Palestinian people and brought the case, requested last week.

South Africa's foreign minister, Naledi Pandor, said the country's allegation that a genocide is underway is getting ''stronger and stronger by the day.''

''We are really pleased that the court has given very serious consideration to the matters that we put before it and has affirmed that an urgent decision is needed from the court to pause this onslaught against innocent Palestinian people,'' she told South African state broadcaster SABC, adding that it's now up to the U.N. Security Council to determine how to protect the Palestinians.

The cease-fire request is part of a case accusing Israel of committing genocide during its Gaza campaign. Israel vehemently denies the allegations. The case will take years to resolve, but South Africa wants interim orders to protect Palestinians while the legal wrangling continues.

The court ruled Friday that Israel must ensure access for any fact-finding or investigative mission sent by the U.N. to investigate the genocide allegations.

At public hearings last week at the International Court of Justice, South Africa's ambassador to the Netherlands, Vusimuzi Madonsela, urged the panel of 15 international judges to order Israel to ''totally and unconditionally withdraw'' from the Gaza Strip.

The court has already found that Israel's military operations pose a ''real and imminent risk'' to the Palestinian people.

Israel's offensive has killed more than 35,000 Palestinians, according to Gaza's Health Ministry, which doesn't distinguish between combatants and civilians. The operation has obliterated entire neighborhoods, sent hundreds of thousands of people fleeing their homes, and pushed parts of the territory into famine.

''This may well be the last chance for the court to act,'' Irish lawyer Blinne Ní Ghrálaigh, who is part of South Africa's legal team, told judges last week.

In January, ICJ judges ordered Israel to do all it could to prevent death, destruction and any acts of genocide in Gaza, but the panel stopped short of ordering an end to the military offensive. In a second order in March, the court said Israel must take measures to improve the humanitarian situation.

The ICJ rules in disputes between nations. A few kilometers (miles) away, the International Criminal Court files charges against individuals it considers most responsible for war crimes, crimes against humanity and genocide.

On Monday, the ICC's chief prosecutor, Karim Khan, said he has asked ICC judges to approve arrest warrants for Netanyahu, Defense Minister Yoav Gallant and three top Hamas leaders — Yahya Sinwar, Mohammed Deif and Ismail Haniyeh — of war crimes and crimes against humanity in the Gaza Strip and Israel.

___

This story was updated to correct that the International Criminal Court is not a U.N. court.

___

Associated Press reporters Gerald Imray in Cape Town, South Africa, and Julia Frankel in Jerusalem contributed. ___

Find more AP coverage at https://apnews.com/hub/israel-hamas-war