Hisham Abu Hawash, a 40-year-old father of five and a member of the Islamic Jihad militant group, began the strike against Israel's system of “administrative detention”, under which people can be held for years without being charged or seeing the evidence against them.
His lawyer, Jawad Boulos, said he agreed to end the hunger strike after Israel pledged to release him on February 26.
The Prisoners’ Club, which represents former and current Palestinian prisoners, hailed the strike as a victory. It said Mr Abu Hawash had previously spent eight years in Israeli prisons, more than half of it in administrative detention.
There was no immediate comment from Israeli officials.
Concern over Mr Abu Hisham's health has been mounting after medical teams from the International Committee of the Red Cross found him to be “in critical condition requiring expert clinical monitoring".
The organisation said that Mr Abu Hawash, who comes from the Israeli-occupied West Bank, has been refusing food for about 140 days.
The UN reiterated its opposition to administrative detention on Tuesday after hearing of the deal.
“We think obviously the fact it's been resolved is a good thing,” spokesman for the world body's secretary general Stephane Dujarric told reporters on Tuesday.
“We have, as a matter of principle, always been very clear in saying that people who are detained should be tried — charged and tried — in accordance with due process, or released. And that has been our position on administrative detention.”
Israel says the measure is needed to foil attacks and to detain dangerous militants without revealing sensitive intelligence sources. Israeli and international rights groups say the practice denies people the right to due process.
Videos posted to social media reportedly show Palestinians lighting fireworks and celebrating in the streets after hearing the news of Mr Abu Hawash's coming release.
The 2.5 million Palestinians living in the occupied West Bank are subject to Israeli military courts, while Jewish settlers living in the territory are citizens subject to Israel’s civilian justice system. Israel captured the West Bank in the 1967 war while Palestinians want it to form the main part of their future state.