Israeli authorities said they would stop working Thursday with the main United Nations agency caring for Palestinian refugees, threatening aid deliveries for Gaza that are a key part of the cease-fire deal.

The East Jerusalem headquarters of the United Nations Relief and Works Agency showed few signs of life Wednesday after Israeli visas issued to international staff expired and those workers left the country. Other employees were told to work from home a day ahead of Israel’s deadline for the agency to close up shop there and vacate the premises.

The U.N. has said that in the absence of Unrwa, it is the legal responsibility of Israel, as the occupying military power in the West Bank and the Gaza Strip, to take care of the Palestinians under its jurisdiction. Israel declined to comment on that claim but said its problem is with Unrwa and that aid will continue to flow.

Israel passed legislation in October that bars Unrwa from operating in Israel and prevents Israeli officials from interacting with the agency. The legislation goes into effect Thursday.

The laws reflect Israel’s allegations that the U.N. agency is biased against Israel and has employed participants in the Hamas-led Oct. 7, 2023, attacks that left 1,200 dead.

They threaten to cripple the agency that runs the largest aid operation in the Gaza Strip and West Bank. The situation is particularly fragile in Gaza, where most of the population of the war-battered territory has been displaced and is heavily dependent on aid.

Other agencies that supply aid rely heavily on Unrwa’s distribution network within Gaza, including its trucks, warehouses, shelters, staff and distribution points. The aid community has warned that Unrwa’s capabilities can’t be easily replaced.

“There is no alternative that has been set up, and there’s not any obvious alternative,” said Dave Harden, a former U.S. Agency for International Development mission director in the West Bank and Gaza. “This was a problem that was foreseeable that nobody did anything about.”

Israel doesn’t believe a single agency will shoulder Unrwa’s responsibilities. Instead, a range of other international organizations would take over parts of Unrwa’s role based on their expertise, an Israeli official close to the issue said.

The agency said it isn’t that simple, given that other humanitarian agencies within and outside the U.N. system rely on its infrastructure.

“Without Unrwa, certain things just can’t be done, and other things will just massively slow down and grind to a halt,” said Sam Rose, a senior official with the agency in Gaza. “It makes an already fragile cease-fire more tenuous.”

Roland Friedrich, director of Unrwa’s affairs in the West Bank, said the agency would try to continue operating to the fullest extent possible after the Israeli laws are in effect.

“The main operational stumbling block is the no-contact policy,” Friedrich said. He said it was unclear how Israel would enforce that policy, which could affect everything from imports to permits to heading off accidental incidents with the military while operating in a war zone.

“We have no official communication from the Israeli authorities,” Friedrich said.

The Coordinator of Government Activities in the Territories, the Israeli military organization that oversees administrative issues including aid deliveries in the occupied Palestinian territories, has been cutting back its direct conversations with Unrwa for months, the Israeli official said.

Israel committed to a big increase in aid deliveries under the Gaza cease-fire struck nearly two weeks ago. While the flood of aid that has come with the pause in fighting has eased some of the pressure related to finding an alternative to Unrwa, the situation will become much more complicated if the cease-fire falters and there isn’t a plan to take up Unrwa’s roles, the Israeli official and the head of a humanitarian organization working in Gaza said.

Israel has long been at odds with the U.N. about the role the agency plays in the Palestinian territories and stepped up its criticism in the wake of the Oct. 7 attack. It has accused at least 12 Unrwa workers of participating in the assault on southern Israel and later alleged that Unrwa employed hundreds of Palestinians with links to Hamas and other militant groups.

The U.N. has called Israel’s effective ban of an agency under the global body an unprecedented action by a U.N. member state.

The 75-year-old agency, established shortly after the founding of the state of Israel, provides many Palestinians with a crucial safety net of healthcare, education and food. Many specialized U.N. agencies haven’t worked extensively in the Palestinian territories because Unrwa was doing the job.

Unrwa has distributed meals to hundreds of thousands of Palestinians since the cease-fire went into effect in Gaza. It was planning another potential polio vaccination campaign following one that Unrwa helped lead after the virus appeared there for the first time in a quarter-century.

In addition, Unrwa was helping blunt an economic crisis in the West Bank in the midst of a tense environment of militancy, government raids and settler violence .

A petition submitted by Israeli legal and rights groups for an injunction to stop the anti-Unrwa legislation from going into effect was turned down by an Israeli high court on Wednesday.

Yossi Mekelberg, a Middle East analyst at the London-based think tank Chatham House, said the lack of a contingency plan to fill the void left by Unrwa in the Palestinian territories will likely exacerbate humanitarian and economic crises and instability.

“For Israel, passing these laws was a protest statement, so it didn’t come up with a plan. And neither Unrwa nor the international community have had the time to come up with a plan while they were dealing with humanitarian crises in Gaza and the West Bank,” Mekelberg said. “From now, it is all about crisis management.”

Write to Omar Abdel-Baqui at omar.abdel-baqui@wsj.com