A Palestinian footballer who has been on hunger strike in protest at being held in an Israeli jail without charge has agreed to resume eating in exchange for early release, his lawyer says.
Mahmoud al-Sarsak has been detained by Israel for three years.
Israeli officials accuse him of being involved in the militant group, Islamic Jihad, but he has never been publicly charged.
Mr Sarsak has always denied the allegations.
He has been held under Israel's "Unlawful Combatants Law", which allows Israel to indefinitely detain without charge or trial foreign nationals suspected of involvement in organisations or activities hostile to the state. Suspects' cases are reviewed by a court every six months.
Israel says Mr Sarsak was arrested based on information that he was a member of the Palestinian militant group Islamic Jihad, had planted bombs and recruited and trained other militants.
Mr Sarsak's lawyer, Mohammed Jabarin, says an agreement has been reached with the Israeli prison where Mr Sarsak is being held for him to be released on 10 July.
In return, Mr Sarsak will start eating again and will be transferred to a civilian hospital for treatment on Tuesday, according to Mr Jabarin.
An Israeli government official, speaking on condition of anonymity, told the BBC: "We know that Sarsak was under enormous pressure and intimidation from Islamic Jihad to continue his strike.
"As Islamic Jihad are aware, Sarsak could have died if he did not stop. This death could have been used to spark violence on the Palestinian street against Israelis and others, violence that would not have been welcomed by anyone except Islamic Jihad and their ilk."
The 25-year-old started his hunger strike on 23 March. He briefly paused in April after rights groups said he was close to death.
In recent weeks, however, he has started taking vitamins, sugar and milk, his lawyer says.
The Palestinian Football Association (PFA) has urged European football's governing body, Uefa, to ban Israel from hosting the continent's under-21 championship next year.
In addition to Mr Sarsak, Olympic squad goalkeeper Omar Abu Rois and Ramallah player Mohammed Nimr are being held in Israel without trial.
The global governing football body, Fifa, expressed its concern last month over the fate of Mr Sarsak and asked Israel's football association to take action.