A protester uses a sling shot to throw back a tear gas canister fired by Israeli solders securing the border during clashes on the Israeli border eastern Gaza City, Friday, May 26, 2017. (AP Photo/Adel Hana)

A protester uses a sling shot to throw back a tear gas canister fired by Israeli solders securing the border during clashes on the Israeli border eastern Gaza City, Friday, May 26, 2017. (AP Photo/Adel Hana)

JERUSALEM (AP) — Hundreds of hunger-striking Palestinian prisoners ended their 40-day fast on the first day of the month-long Muslim holiday of Ramadan, after reaching a compromise with Israel for additional family visits, Israeli and Palestinian officials said.

Israel prison service spokeswoman Nicole Englander said the inmates declared an end to the strike Saturday morning. She said it came after a deal was reached with the Palestinian Authority and the Red Cross for prisoners to receive a second family visit each per month.

Hundreds of prisoners observed the strike they said was aimed at improving prison conditions.

ADVERTISEMENT

The hunger strike had evolved into one of the longest such protests with this many participants since Israel’s 1967 capture of territories Palestinian seek for their state in the West Bank, east Jerusalem and the Gaza Strip.

Englander said 1,578 prisoners participated in the hunger strike overall, some fasting intermediately, and 834 ended their fast Saturday. She said 18 were being treated in hospitals.

Many Israelis view the prisoners as terrorists and have little sympathy for their demands. More than 6,000 Palestinians are currently in prison for offences linked to the Israeli-Palestinian conflict, for charges ranging from stone-throwing to weapons possession and attacks that killed or wounded Israeli civilians and soldiers in bombings, shootings and other violence.

Several hundred are being held without trial in so-called administrative detention. Israel has defended the practice as a necessary tool to stop militant activity, including preventing deadly attacks.

Critics condemn it because there are no charges and judges can extend the detentions. They add that the practice is overused.

Palestinians rallied behind the hunger strikers as national heroes, relishing a rare break from deep divisions between two rival political groups, the Islamic militant group Hamas which runs Gaza and Fatah, the movement of Western-backed Palestinian President Mahmoud Abbas who administers autonomous enclaves in the Israeli-occupied West Bank. Palestinians hoped the protest would draw the attention of a seemingly preoccupied international community as the Israeli occupation hits the 50-year mark in early June.

Support for the prisoners is an emotional consensus issue; hundreds of thousands of Palestinians have been jailed by Israel since 1967.

ADVERTISEMENT

Israel’s public security minister, Gilad Erdan, alleged that the hunger strike was motivated by a power struggle in Abbas’ Fatah movement. He claimed that imprisoned strike organizer Marwan Barghouti cynically exploited his fellow prisoners to boost his standing in Fatah and promote his position as a possible successor to Abbas. Barghouti’s family has denied such claims.

Qadoura Fares, who runs the Prisoners’ Club advocacy group, said negotiations took place between Israel officials and a committee from the prisoners, which included Barghouti. He said negotiations began on Friday and were the first since the strike began. Fares said he had no details on the terms of the deal.

He said the agreement was reached at 4 a.m. coinciding with start of the first day of Ramadan, the Muslim holy month where the devout pray intensely, observe dawn-to-dusk fasting and enjoy nightly feasts.

Barghouti is serving five life terms after being convicted by an Israeli court of directing two shooting attacks and a bombing that killed five people. In prison since 2002, he never mounted a defense, saying the court had no jurisdiction over him.

Earlier this month, Israel released footage it said shows Barghouti breaking his fast. Palestinians say the video is a fabrication.

Also Saturday, thousands of Israelis demonstrated in central Tel Aviv in the evening in support of establishing a Palestinian state alongside Israel to end the conflict.

Avi Buskila of Peace Now said in a statement the protest is “against the lack of hope offered to us by the right wing government.”

He said “This is the time to illustrate to Israelis, to the Palestinians and to the world that a large portion of the Israeli public opposes the occupation and seeks to arrive at a two state solution.”

Organizers of the rally received a letter from Palestinian President Mahmoud Abbas that was read on stage calling for a Palestinian state based on 1967 lines. “It is time to live, you and us, in peace, harmony, security and stability,” it said.

President Donald Trump pushed for peace between Israel and the Palestinians when he visited the region this week but gave no details on how to achieve that.