Istanbul (AFP) - Turkish journalist Mehmet Altan was Wednesday freed after almost two years in jail in a case that intensified concerns about freedom of expression under President Recep Tayyip Erdogan.

Altan, first arrested in September 2016 for alleged links to the group blamed for the 2016 failed coup and then sentenced to life jail, was released from the Silivri prison outside Istanbul following an earlier court ruling, the P24 press freedom group said in a statement.

His conviction and life sentence have not been quashed and he remains subject to a travel ban and obligation to report to authorities regularly.

The constitutional court in January had ruled that Altan should be released on the grounds his rights had been violated but, to the fury of his supporters, a lower criminal court ignored this and he remained in jail.

The European Court of Human Rights had in March also ruled that Altan's human rights had been violated by his detention.

"I am freed after 21 months, when I should never have been taken into custody," P24 quoted him as saying outside the jail where he was welcomed by friends and colleagues.

"Let my release be some hope on the way to law and democracy," he added. "Got willing this will mark an end to this persecution."

- 'Travesty of justice' -

Wednesday's ruling was made by an Istanbul regional court which heard his appeal and based its decision on the previous "binding" ruling of the constitutional court.

"The release of Mehmet Altan was long overdue," Amnesty International's Europe Director Gauri van Gulik said in a statement.

"His imprisonment was a travesty of justice that was emblematic of the deep flaws within the Turkish justice system."

Altan, an economics professor and columnist for top newspapers, was sentenced to life in jail in February alongside other prominent suspects including his brother Ahmet, a writer and novelist, and veteran journalist Nazli Ilicak.

The Istanbul regional court ruled to keep Ahmet Altan and Ilicak in jail and adjourned the next session in the appeal hearing for September 21. Mehmet Altan's appeal against his conviction will also continue to be heard then.

Story continues

They are charged with links to the group of US-based preacher Fethullah Gulen who Ankara blamed for the coup bid. Gulen denies the accusations.

The journalists' convictions -- ridiculed by supporters -- were based on a TV appearance on the eve of the failed coup where they allegedly sent "subliminal messages" calling for the overthrow of Erdogan's government.

- 'Thousands of others' -

Their cases set off alarm bells over the freedom of press in Turkey under the two-year state of emergency imposed after the failed coup that has seen dozens of journalists arrested.

Mehmet Altan's release comes three days after Erdogan won presidential and parliamentary elections with new enhanced powers as head of state.

Ahead of the elections, Erdogan had vowed to lift the state of emergency after his inauguration for the new term. But activists say they are awaiting action rather than words.

In a separate development, an Istanbul court also ordered the release of rights activist Celalettin Can who had been held since February.

"The courts must now turn their attention to the thousands of others who remain unfairly detained in Turkey," said van Gulik of Amnesty, noting that the rights group's Turkey chair Taner Kilic remains in jail after over a year behind bars.

According to P24, before Mehmet Altan's release there were 182 journalists detained in Turkey, most of them jailed under the state of emergency.