A Palestinian man stands chained to a cage during a demonstration in the city of Ramallah, in solidarity with Palestinian prisoners on hunger strike in Israeli jails. Some 1,550 Palestinian prisoners were on hunger strike. (Abbas Momani/AFP/Getty Images)

Israeli and Palestinian officials announced Monday that more than 1,600 Palestinian prisoners had agreed to end a nearly month-long hunger strike in exchange for concessions by Israel, including a modification to its practice of detention without charge or trial.

The prisoners — all jailed in Israeli military prisons on suspicion or convictions of terror-related activity — agreed to “completely halt terrorist activity inside Israeli prisons,” Israel’s domestic security agency, the Shin Bet, said in a statement.

But it was unclear Monday night whether the deal, which Israeli officials said was mediated by Egypt and Jordan, would end the fasts of the eight detainees who have been on the longest hunger strikes. An attorney for three prisoners who have been fasting for more than seven weeks said they would continue. Two of those prisoners, Bilal Diab and Thaer Halahleh, have not eaten for 77 days, and human rights organizations say they are near death.

The deal came one day before Palestinians are to observe a national day of mourning over Israel’s establishment 64 years ago, and officials on both sides feared that tensions over the prisoners’ strike — or the possible deaths of the prisoners who are in life-threatening situations — could trigger violence during the annual demonstrations.

Officials on both sides said that under the terms of the deal, Israel agreed to end solitary confinement and allow prisoners from the coastal Gaza Strip to receive visits from immediate relatives, as is allowed for prisoners from the West Bank. Family visits from Gaza were suspended in 2006, after Israeli soldier Gilad Shalit was taken hostage and transferred to Gaza by Palestinian militants. Shalit was freed last fall in exchange for more than 1,000 Palestinian prisoners, but the family-visit policy did not change.

The officials said Israel also agreed to free about 320 prisoners who are being held without charge or trial in administrative detention, provided they finish their current six-month detention terms and no new evidence against them surfaces.

Administrative detention, which can be renewed indefinitely, is a key focus of the detainees who have been on hunger strike the longest. Critics say Israel uses it punitively and, by withholding evidence from both detainees and their lawyers, prevents them from mounting a proper defense. Israel says divulging that information could expose informants and jeopardize national security.

Sahar Francis, director of the prisoners’ rights organization Addameer, said the concessions granted by Israel amounted to a success for the prisoners. But the change to administrative detention is vague, she said.

“What’s the difference?” she said. “I’m skeptical.”

Jamil Khatib, a lawyer who represents three administrative detainees — Diab, Halahleh and Jafar Izzedine, who has been fasting for 53 days — said they did not think the prisoners who agreed to the deal represented them.

“They denied any proposals that didn’t give them the chance to be released right now,” Khatib said of the men he represents. “They will not end their hunger strike until they will be freed.”

The mass hunger strike, which began April 17, was at least partially inspired by Khader Adnan, an administrative detainee who was granted an early release after a hunger strike of 66 days this year. Another such detainee, Hana Shalabi, was also released after fasting for 40 days.

Last week, the Israeli Supreme Court turned down an appeal requesting the release of Diab and Halahleh. Like Adnan and Shalabi, both are alleged members of Islamic Jihad, an Islamist militant group that fires rockets from Gaza onto southern Israel.

Aziz Halahleh, Thaer Halahleh’s father, said Monday that his son was “very determined to continue his hunger strike.”

Hassan Abed Rabo, a spokesman for the Palestinian Ministry of Detainees and Ex-Detainees, said Israel had also agreed to transfer the bodies of 100 Palestinians who were killed fighting the Israelis and buried inside the Jewish state. An Israeli official, who was not authorized to release additional details about the deal, confirmed that provision.

Israeli officials portrayed the deal as a gesture of goodwill to Palestinian President Mahmoud Abbas, who had warned that the hunger strikes could spark unrest.

“It is our hope that this decision will serve to build confidence between the parties and further peace,” Mark Regev, a spokesman for Israeli Prime Minister Benjamin Netanyahu, said in a statement.

The prisoner issue is deeply emotional for Palestinians, most of whom have relatives who are or have been incarcerated in Israeli prisons. Palestinians said at least 2,500 prisoners participated in the hunger strikes.

Special correspondent Samuel Sockol contributed to this report.