The UN's top court has ordered Israel to take all measures to prevent genocidal acts in Gaza, but stopped short of telling it to halt the war.
The highly anticipated hearing was part of a controversial case brought by South Africa.
South Africa had asked the court to order Israel to stop military action straight away pending a decision on whether Israel has committed genocide.
Israel has vehemently rejected the accusation as "wholly unfounded".
Friday's hearing at the International Court of Justice (ICJ) at The Hague was the first time the judges have issued a ruling as part of the case which began two weeks ago. A verdict on the central allegation of genocide is expected to take much longer, possibly years.
Although the court did not call for a halt to Israel's military action, as South Africa had asked it to do, it is being interpreted as a victory for those who support South Africa's case.
The ICJ found it did have jurisdiction on the matter, and decided there was a plausible case under the 1948 Genocide Convention, and that the Palestinian population in Gaza was at real risk of irreparable damage.
"For the implementation of the international rule of law, the [ICJ's] decision is a momentous one," said South Africa in a statement. It called Friday's ruling a "significant milestone in the search for justice for the Palestinian people".
The Palestinian foreign minister said the ruling showed that "no state is above the law", adding it "should serve as a wake-up call for Israel and actors who enabled its entrenched impunity".
Israeli Prime Minister Benjamin Netanyahu did not address the ruling directly but said "Israel's commitment to international law is unwavering. Equally unwavering is our sacred commitment to defend our country."
He said South Africa's allegation that Israel was committing genocide was "not only false, it's outrageous, and decent people everywhere should reject it".
Israeli Defence Minister Yoav Gallant dismissed the ruling, saying Israel "does not need to be lectured on morality in order to distinguish between terrorists and the civilian population in Gaza".
A spokesman for Hamas, the Palestinian group whose unprecedented attack on Israel on 7 October triggered the war, called the outcome "important", saying it contributed to "isolating Israel", Reuters news agency reported.
The ICJ ordered Israel to take a series of measures against potentially genocidal acts against Palestinians in Gaza. These include measures not only on the battlefield but also against public incitement to genocide. It also ordered Israel to take "immediate and effective measures" to enable the provision of aid to people in Gaza.
The court said Israel must report on its compliance to the court within one month.
Although orders issued by the ICJ are legally binding, it does not have the power to enforce them. Israel is not expected to commit itself to the orders.
More than 26,000 Palestinians - mostly women and children - have been killed in Gaza by Israel's bombardment since 7 October, Gaza's Hamas-run health ministry says. Israel launched its offensive after waves of Hamas gunmen burst through the border early that day, killing about 1,300 people - mainly civilians - and taking about 250 others back to Gaza as hostages.