Palestinians carry portraits of prisoners, including Samer Issawi, who was on a hunger strike, in a rally to highlight the situation of Palestinians currently jailed in Israel. Issawi had been on an intermittent hunger strike since August. (ABED AL HASHLAMOUN/EPA)

A Palestinian prisoner whose prolonged hunger strike helped drive weeks of protests recently in the West Bank agreed to end his strike Tuesday after reaching a deal with Israeli authorities for his release in eight months, his attorney said.

The agreement defused a standoff that had raised fears of an explosion of broader unrest if the prisoner died.

Samer Issawi, 33, from Jerusalem, had been on an intermittent hunger strike since August to protest his re­arrest. Refusing food and receiving only infusions of water, vitamins and minerals, he was hospitalized in recent weeks as his condition deteriorated.

In the West Bank and the Gaza Strip, Issawi became a symbol of the 5,000 Palestinians in Israeli jails, whose cause resonates widely in the Palestinian territories. Many people there have relatives in prison and view them as national heroes.

Sentenced in 2002 to 26 years in jail for several shootings and providing weapons for other attacks in the West Bank and Jerusalem, Issawi was released in October 2011 as part of a prisoner exchange that freed Gilad Shalit, an Israeli soldier held captive in the Gaza Strip by the militant group Hamas.

Issawi was arrested in July for entering the West Bank in violation of the terms of his release, which confines him to Jerusalem. Accused of unspecified security of­fenses, he faced possible imprisonment for the remainder of his original term, under amended Israeli military law.

His attorney, Jawad Bulous, said Tuesday that military prosecutors had agreed to free Issawi in December in return for his acknowledgment that he had violated his earlier release terms. “This is a victory for common sense on both sides,” Bulous said.

In a message posted on Facebook, Issawi had recently appealed to Israelis to push for his release, and a group of prominent Israeli writers responded in an open letter urging him to end his strike to prevent further tragedy.

The case of Issawi and other hunger-striking prisoners triggered demonstrations of support in the West Bank in recent months, including a surge of stone-throwing clashes with Israeli soldiers that raised fears in Israel of a slide toward a third Palestinian uprising.

The deaths of two other prisoners in custody fueled the unrest. One detainee died in February while under interrogation by Israel’s Shin Bet security service. Palestinian officials alleged that he had been tortured, but Israeli officials said initial findings of an autopsy did not indicate a cause of death.

A second prisoner died of cancer this month soon after he was hospitalized, prompting Palestinian accusations that Israeli authorities had delayed proper treatment.