Israel and Palestinian security prisoners signed a deal to end a 28-day hunger strike by the inmates on Monday. The Palestinian Authority and Egypt both played a role in helping broker the deal.

According to the terms of the agreement, Palestinian prisoners committed to refrain from dealing with "activities against security" within prison confines. In exchange, they will receive benefits from the Prisons Service, including the end of separation from the general prison population, and family visits.

Leaders of the prisoners who are are outside the prisons issued instructions to the inmates to prevent such terror activities, the Shin Bet (Israel Security Agency) said in a rare statement.

The Shin Bet did not name the leaders of the prisoners who ordered an end to the hunger strike.

However, Hamas and Islamic Jihad officials travelled to Cairo this week for talks with Egyptian government and PA representatives about ways of ending the hunger strike.

The agreement calls for security prisoners to refrain from any activity in support of terrorism, including issuing instructions, financing, coordinating between terrorists and aiding them.

Leaders of the inmates signed the agreement on behalf of all the security prisoners belonging to all groups and who are being held in all Israeli prisons.

The agreement is binding for prisoners who are rearrested in the future.

The pledge that was signed by the leaders of the prisoners states that "activities against security that are carried out from inside the prisons or renewing the hunger strike will lead to the cancellation of Israel's commitment to ease restrictions."

Before reaching the agreement, a committee made up of representatives from the Prisons Service, Justice Ministry, Foreign Ministry, and Health Ministry, as well as the Shin Bet (Israel Security Agency) and National Security Council examined the prisoner's request, and passed on its recommendations.

Prisoners who were on hunger strike will remain under medical supervision to ensure that a return to eating food will not result in medical complications, authorities said.

They added that prisoners received their full legal rights throughout the hunger strike.

Speaking ahead of the deal's signing, the Palestinian Authority's prisoners minister, Issa Qaraqe, said the deal included ending solitary confinement, not renewing administrative detention, releasing all prisoners who have completed their sentences, and allowing family visits and phone calls, Palestinian news agency Ma'an reported.

In addition to the prisoners on hunger strike since mid-April, two other prisoners have refused food for 77 days. It was unclear at the time of this report if those prisoners were also included in the deal.