The announcement signalled Ankara's readiness to retry the Kurdish rebel leader.
Speaking on TRT state television, government spokesman Cemil Cicek also told the Turkish people there was no need to fear Ocalan's release and said they should trust the state and its judicial organs to handle the case properly.
The European Court of Human Right's ruling in the French city of Strasbourg on Thursday is not binding, but could cause political problems for the Turkish government, which is trying to meet the European Union's entry criteria - including conditions on human rights.
"The applicant was not tried by an independent and impartial tribunal," the judges said in a statement.
Ocalan was found guilty of
treason through separatism
Ocalan is serving a life sentence as the sole inmate of a Turkish island prison after being found guilty of masterminding a separatist revolt, in which at least 30,000 people were killed in the 1980s and 1990s.
The ruling still requires the approval of the Council of Europe, Europe's top human rights watchdog, but puts heavy pressure on Ankara to retry Ocalan.
Government ministers said before the ruling that a verdict in favour of a retrial could trigger an explosion of Turkish nationalism and that this could upset plans for the start of accession talks with the EU in October.
Ocalan was jailed nearly six years ago after being found guilty of "treason through separatism". An original death sentence was commuted to life imprisonment after Turkey scrapped the death penalty in 2002, in line with EU requirements.
The EU is watching the case closely as it prepares for the accession talks with Ankara. It hopes to join the wealthy bloc in a decade or so, but must meet strict conditions, including human rights and democracy.
Thursday's ruling confirms a verdict issued by the European Court of Human Rights in 2003. Turkey had appealed against that ruling.