The European Court of Human Rights has condemned Turkey for violating the human rights of jailed Kurdish rebel leader Abdullah Ocalan.
Abdullah Ocalan had complained to the human rights court
The court ruled that Ocalan did not receive a fair trial.
He is currently serving a life sentence as the sole inmate on the prison island of Imrali.
Ocalan was originally sentenced to death in June 1999 for his role in a 16-year guerrilla war against the Turkish authorities in which more than 30,000 people were killed.
In October last year the death sentence was commuted to life in prison, with no chance of parole.
The court in Strasbourg ruled that Ocalan was "not tried by an independent and impartial tribunal".
It also found that Ocalan's rights had been violated by the long delay in bringing his case to court.
But on other complaints lodged by Ocalan's lawyers, the court ruled in Turkey's favour. The seven judges rejected charges that Ocalan's conditions of detention were inhumane or that he had been illegally detained.
Both sides have three months to lodge an appeal.
Ocalan, who was captured in Kenya by Turkish authorities in February 1999, led the separatist Kurdistan Workers' Party (PKK). The group, which sought a homeland in south-east Turkey, declared a ceasefire following Ocalan's capture.
Turkey abolished capital punishment in 2001 as part of reforms aimed at boosting its chances of joining the European Union.
Ocalan was Turkey's most wanted man for two decades. He lived in exile from the early 1980s, mostly in Syria.
In October 1998 he was expelled from Syria and from there went to Greece, Russia, Italy, then again Russia and Greece, before going to Kenya, where Turkish officials finally arrested him.
His arrest prompted Kurdish demonstrations across Europe, as many Kurds were indignant about the way in which the Turkish state paraded their captured leader before TV cameras.
The aim of Ocalan's appeal to the Strasbourg court was to lift the death sentence. When the death sentence was commuted, he continued to contest the conditions of his arrest, trial and imprisonment.
Wednesday's non-binding ruling puts pressure on Turkey to hold a re-trial.