Israel has offered to release a Palestinian man who has been on hunger strike for 65 days in protest at his indefinite detention without charge.
A lawyer for Mohammed Allan said the offer was received shortly before the Israeli Supreme Court was to consider whether to free him on medical grounds.
In return for ending his hunger strike, he would be released in early November.
The 31 year old is being treated at a hospital in Ashkelon, where doctors say he is in a serious condition.
Ms Allan, a lawyer and member of the militant group Islamic Jihad, lost consciousness and was placed on a respirator on Friday after his lungs stopped working and he had seizures. He was also given salts and minerals intravenously.
On Tuesday, he regained consciousness and told his lawyers that he would stop consuming water within 24 hours if there was no acceptable deal to release hm.
The previous day the Israeli authorities had offered to let him go if he agreed to live in exile for four years – something his lawyers immediately rejected.
Mr Allan began the hunger strike on 16 June in protest against his incarceration since November 2014 under what Israel calls administrative detention.
The system allows a military court to order suspects to be detained indefinitely, subject to renewal every six months by the court, without charge or trial.
The Israeli justice ministry alleges that Mr Allan is involved in “grave terrorism”, and that “classified information” warrants keeping him detained.
On Wednesday morning, shortly before the Supreme Court hearing, Israeli officials informed Mr Allan’s lawyers that they were prepared to free him when his current six-month period of administrative detention expired on 3 November.
One of Mr Allan’s lawyers, Kamal Natur, said he would recommend accepting it.
“I think that under these circumstances, this offer is realistic and it would be best for him to accept it,” he told Israeli Army Radio. “This is the offer that I expected to receive, but I can’t predict, given his condition, whether he will accept it or not.”
Mr Allan’s hunger strike has continued despite Israel’s parliament passing a law last month, which doctors strongly opposed, that would allow the authorities to force-feed detainees to keep them alive.
The New York Times reports that Israeli officials could not find a doctor willing to carry out medical tests on Mr Allan and set in motion the law’s application before his health deteriorated too rapidly for force-feeding to be a viable option.
There are fears that violence in the Israeli-occupied West Bank might escalate if Mr Allan dies.
Tensions have soared in recent weeks since an arson attack on a Palestinian home that killed an 18-month-old boy and his father.