The deal ended one of the largest prison protests ever staged by the Palestinians. Two men had refused food for 77 days, the longest ever Palestinian hunger strike, leaving them in life-threatening conditions, according to their supporters.
With the Palestinians set to hold an annual day of mourning on Tuesday, both sides were eager to wrap up a deal to lower tensions. The Palestinians are marking what they call the "nakba," or "catastrophe," the term they use in describing the suffering that resulted from Israel's establishment 64 years ago.
Both Israeli and Palestinian officials, as well as representatives of Palestinian militant groups, confirmed the deal had been signed on Monday afternoon. Egyptian mediators had brokered the deal, in which Palestinian officials from the West Bank, militant leaders and prisoner representatives participated over several days.
Two men launched the strike on Feb. 27, and were joined by hundreds of others on April 17.
Among their demands: permission to receive family visits from the Hamas-controlled Gaza Strip and an end to solitary confinement.
More ambitiously, they also demanded an end to an Israeli policy of "administrative detention," under which suspected militants are held for months, and sometimes years, without being charged. Israel has defended the policy as a necessary security measure.
Israel said it had granted many of the requests, including new limits on administrative detention. While the policy wasn't scrapped, detentions cannot be extended if Israel does not present additional intelligence information to a military court, according to the Shin Bet security agency.
The Shin Bet also said the roughly 400 prisoners from Gaza will now be allowed to receive family visits, like their West Bank brethren. The visits from Gaza were halted in 2006 after Hamas-linked militants in Gaza captured an Israeli soldier. After the soldier was released in a prisoner swap last October, the Palestinians said the ban should be lifted.
Israel also said it would halt its punitive policy of placing prisoners in solitary confinement and allow prisoners to make phone calls to relatives. Palestinian officials said prisoners would also be permitted to pursue academic studies.
The Shin Bet said in return, the prisoners pledged "to absolutely stop terror activity from inside Israeli jails." It also said militant group's commanders outside the jails made a commitment "to prevent terror activity." It said militant violence or resumed prisoner strikes would "annul the Israeli commitment."
The two longest strikers, Bilal Diab and Thaer Halahleh, who have gone 77 days without food, had said they would not start eating again until their administrative detentions are lifted.
Diab has been held without charge since last August, and Halahleh has been in administrative detention since June 2010, and spent an additional six and a half years in administrative detention last decade.
Israel has not said what they are suspected of doing. Both men are members of Islamic Jihad, a violent Palestinian militant group that has killed hundreds and maimed many more in suicide bombings, shootings and other attacks.
It was not immediately known whether the pair would be released. Another Islamic Jihad militant, Khader Adnan, staged a 66-day hunger strike earlier this year that ended after Israel agreed to free him.
Israel said some 1,600 prisoners, or more than a third of the 4,500 Palestinians held by Israel, joined the hunger strike. Palestinians said the number was closer to 2,500.
The fate of the prisoners is an emotional issue in Palestinian society, where nearly everyone has a neighbour or relative who has spent time in an Israeli jail. As the strike dragged on, hundreds of Palestinians took to the streets of the West Bank and Gaza to demonstrate in solidarity.
For families of the prisoners, any deal that did not win freedom of the prisoners fell short.
"Will they release Bilal? Is it over?" asked Missadeh Diab, the elderly mother of Diab, one of the prisoners who refused food for 77 days. "May God give your demands and freedom."
Israeli officials expressed hope that the prisoner deal would help bring President Mahmoud Abbas back to the negotiating table. Abbas has refused to engage in peace talks with Israeli Prime Minister Benjamin Netanyahu, demanding that Israel halt construction of Jewish settlements in the occupied West Bank and east Jerusalem.
Ofir Gendleman, a spokesman for Netanyahu, said as an additional gesture, Israel would return to the Palestinians the bodies of 100 militants killed in combat against Israel.
Haitham Hamad in Ramallah, West Bank, and Ibrahim Barzak in Gaza City, Gaza Strip, contributed to this report.