Israel has agreed to free Khader Adnan, a Palestinian detained without charge, who has been on hunger strike for more than nine weeks, one of his lawyers has said.
The revelation came hours before the supreme court was to hear an urgent appeal on Tuesday for Adnan's release.
The lawyer said that a settlement had been reached for ending his detention.
The continued 'administrative detention' of the Palestinian from the West Bank had stroked global anger with protesters clashing again with police in the West Bank on Tuesday.
Israel arrested Adnan, a 33-year-old baker, on December 17 near the northern West Bank town of Jenin. Israel accuses him of being a spokesman for the Palestinian group, Islamic Jihad.
He told lawyers and human rights organisations that masked soldiers violently broke into his house, where his mother and children were present.
Adnan said that his hands were shackled behind him and that he was thrown onto the floor of the military jeep and kicked and slapped by soldiers while they took him to the settlement of Mevo Dotan.
He began refusing food a day after his arrest and is now said to be in critical condition.
Earlier, Saeb Erakat, the chief Palestinian negotiator, urged world leaders to pressure Israel to free Adnan.
"I sent messages to US Secretary of State Hillary Clinton and EU foreign policy chief Catherine Ashton today, and spoke with the EU and Chinese envoys," Erakat told AFP news agency.
"I asked them all to intervene in Adnan's case. They must apply pressure on Israel to release him," he said.
World leaders had expressed growing concern over the fate of the prisoner, who was held without charge under a procedure known as "administrative detention".
There are currently more than 300 Palestinians being held in administrative detention by Israel, without charge or trial, for renewable periods of six months, without any way of defending themselves.
Palestinian officials warned that his death in custody could start a violent backlash, while a spokeswoman for the Israel Prisons Service said on Sunday that they were "constantly monitoring" the situation.
"We understand the implications of this case," Sivan Weizman said.
But on Monday, Prime Minister Benjamin Netanyahu's office went on the offensive, with a spokesman describing Adnan as "a dangerous terrorist" despite the fact he has yet to be charged with any security offences.
Until now, Adnan has not been charged and the military court that approved Adnan's detention has refused to release any details on the reason for his arrest or ongoing imprisonment.