Turkey's trial of Kurdish rebel leader Abdullah Ocalan was unfair, the European Court of Human Rights in Strasbourg has ruled.
Former PKK leader Ocalan is serving life in prison
Turkey said it would address flaws found by the court - suggesting a retrial would be an appropriate option.
Ocalan was convicted of treason in 1999. He was blamed for 30,000 deaths in a 15-year war between his PKK group and Turkish security forces.
A retrial in Turkey could stir tensions as it makes its bid for EU membership.
"The applicant was not tried by an independent and impartial tribunal," the European Court of Human Rights (ECHR) said in a statement.
KEY DATES IN OCALAN CASE
Feb 99: Turkey captures Ocalan
May 99: Treason trial begins
June 99: Ocalan sentenced to death
Oct 99: Ocalan appeals
Nov 99: Turkey throws out appeal
Dec 00: ECHR allows appeal
Sept 02: Turkey commutes death sentence to life
March 03: Lower chamber of ECHR says trial 'unfair'
June 04: Higher chamber of ECHR begins Ocalan appeal
May 05: Higher chamber confirms 'unfair trial' verdict
The judges ruled that the presence of a military judge on the panel meant that the Turkish court's judgement could not have been fair.
They did not directly call for a retrial but said retrying or reopening Ocalan's case would be "an appropriate way of redressing the violation".
Ocalan's lawyer, Markus Mueller, said he was "very satisfied" with the ruling.
"It's been a long journey and an odyssey of justice for Mr Ocalan, but I think at the end of the day he's got the right result," he said.
Ocalan is currently serving a life sentence as the sole inmate of a prison on a Turkish island.
Turkey scrapped the death penalty in 2002 to come into line with European Union requirements.
Turkey is one of the 46 members of the Council of Europe, which set up the ECHR. The Grand Chamber's judgement is final for Council members and cannot be appealed.
Turkey is at present trying to meet the EU's entry conditions on human rights.
"The Turkish Republic is a state based on the rule of law and will undertake the procedure that the law requires," said Dengir Mir Mehmet Firat, deputy chairman of the ruling Justice and Development Party, quoted by AFP.
In an interview on state television, a government spokesperson said that the Turkish people should not fear Ocalan's release and should have faith in the state's ability to handle the case.
Correspondents say this indicates that the court is willing to retry the former leader of the Kurdistan Worker's Party. A lower chamber of the European Court has already criticised many aspects of the original trial, including Ocalan's lack of access to the proceedings and the imposition of the death penalty.
The BBC's Steve Bryant in Istanbul says a retrial would awaken violent passions among both Turkish and Kurdish nationalists.
Ocalan's capture by Turkish intelligence agents and subsequent conviction were a cause for huge jubilation across much of Turkey.
There is little doubt, our correspondent says, that Ocalan - a figure of hatred for the majority of hardline Turkish nationalists - would be convicted again.
But the government is worried that a retrial would provide an opportunity for Ocalan to address and rally his PKK rebels, sparking an explosion of Turkish nationalism.