JERUSALEM -- A Palestinian held without charge by Israel ended his unprecedented 66-day hunger strike Thursday, his lawyer said, after the Supreme Court ordered him released from detention.

The decision by Mohammed Allan to halt his fast appeared to avert a crisis over two controversial Israeli actions that threatened to unleash Palestinian violence as his health deteriorated.

Allan's case tested a new Israeli law allowing fasting inmates to be force-fed, a measure that many doctors say amounts to torture. It also cast light on Israel's use of administrative detention -- the holding of suspects in special cases for long periods without charge.

Allan, 31, ended his strike Thursday, according to his lawyer, Jamil Khatib, who added that his client was still in serious but stable condition in Barzilai hospital in the southern Israeli city of Ashkelon. He said it could take several weeks to determine how much Allan's health was damaged by the prolonged fast.

Allan, who lost consciousness Aug. 14, was showing "great improvement," said Dr. Hezy Levy. He had regained consciousness Monday, and he was said to have suffered some brain damage as a result of the fast.

"We took him off the respirator. He's no longer sedated," Levy said. "He is starting to communicate and I am happy that medically he is on the right path."

Levy said he hoped that Allan would soon start eating again on his own. Allan's body cannot yet process food after such a prolonged fast.

During his hunger strike, Allan was not force-fed, which entails inserting a feeding tube into his stomach. He was, however, given intravenous fluids, vitamins and nutrients as his condition deteriorated.

Allan was now "a free man," Khatib said, adding that he does not believe Israel would renew Allan's detention period when it ends Nov. 3.

The Supreme court suspended the detention order Wednesday, releasing Allan while he receives medical care. The court did not specify what would happen to Allan if he recovers, saying only he can petition for his release if his condition improves.

He began his fast to protest the policy of administrative detention. Israeli authorities argue the measure is needed to stop militant attacks, adding that revealing the charges would expose intelligence networks and put lives in danger. Rights groups say it violates due process, is meant only for extraordinary cases, and is overused.

Israel said Allan was put under detention for his affiliation with Islamic Jihad, a Palestinian militant group that has carried out scores of attacks on Israeli civilians and soldiers. Allan denies the affiliation.

Israel first arrested Allan in 2006 and jailed him until 2009 for enlisting suicide bombers for Islamic Jihad and helping wanted persons, according to a defence official who requested anonymity because he was not authorized to talk to the media. At the time of his arrest, Allan was a known activist and leader in the student wing of the Palestinian Islamic Jihad group at his university in the West Bank. After his release, Allan finished his law degree and opened a practice in the West Bank city of Nablus.

Sawson Zaher, a lawyer with the advocacy group Adallah that represented Allan, said the Israeli court's decision showed administrative detention is an "arbitrary and punitive tool" against Palestinians.

Palestinian prisoners have used hunger strikes before to draw attention to the practice of administrative detention. Fearing that a death could spark Palestinian violence, Israel has at times acceded to hunger strikers' demands. In June, Israel freed Khader Adnan, 36, a senior Islamic Jihad activist, after a 55-day fast.

A law narrowly approved by Israel's parliament in July sought to curtail hunger strikes by permitting a judge to sanction force-feeding of a prisoner whose life is in danger.

Critics of force-feeding see it as an unethical violation of patient autonomy and akin to torture. The U.S. has admitted to force-feeding detainees at its Navy base in Guantanamo Bay, Cuba, and Britain force-fed some Irish Republican Army prisoners on hunger strikes.

The Israeli Medical Association, which has urged physicians not to co-operate, is challenging the law in the Supreme Court.

As Allan's health worsened, Palestinians organized several solidarity protests in the West Bank. Clashes broke out outside Barzilai hospital between his supporters and opponents on several occasions.

Israeli authorities worried that his death could lead to unrest, but also insisted that his release would only encourage other prisoners to begin hunger strikes to demand their freedom as well.

In Gaza, the Islamic Jihad group threatened to renew attacks if Allan died. On Wednesday some 20 Palestinian prisoners said they were on hunger strike in solidarity with Allan.

Israel's "Iron Dome" missile-defence system was deployed in the south. Media reports said it was in case Islamic Jihad or other militant groups launched attacks over the hunger strike. The military would not comment in line with official protocol.