ANKARA (Reuters) - A Turkish court on Friday sentenced six journalists, including two prominent brothers, to life in jail for aiding plotters of a 2016 failed coup, state media said, a sharp turnaround after the country’s highest court ordered one of the men released.

Mehmet Altan, an economics professor and journalist, and his brother Ahmet, also a journalist, were accused of giving coded messages on a television talk show a day before the abortive military putsch. Nazli Ilicak, another well known journalist, was also among the sentenced. All six have denied the charges.

The case has underscored both the deep concern about press freedom in Turkey as well as worries about the independence of the judiciary under President Tayyip Erdogan. Since the coup more than 50,000 people have been jailed and more than 150,000 sacked or suspended from their jobs.

The verdict drew fierce criticism from rights groups and international bodies, including from the U.N. and OSCE experts on media freedom, who said Turkey should reverse the decision.

“These harsh sentences are an unacceptable and unprecedented assault on freedom of expression and on the media in Turkey,” David Kaye and Harlem Desir said in a joint statement issued by the U.N. human rights office.

The court imposed aggravated life sentences on the six defendants who were found guilty of “seeking to overthrow the constitutional order by force”, the state-run Anadolu news agency. At least three of the men have already been in prison for about 17 months.

The constitutional court, Turkey’s highest, had previously ruled for Mehmet Altan’s release, saying that his detention amounted to the violation of his rights. However, the penal court rejected the request and decided to keep him in jail as his trial continued.

The sentencing came on the same day that another Turkish court ordered the release of Deniz Yucel, a German-Turkish journalist who spent just over a year in pre-trial detention without an indictment, in a case that tested relations between Ankara and Berlin.

CODED MESSAGES

Ahmet Altan was charged after he said on a TV show: “Whatever the developments were that lead to military coups in Turkey, by making the same decisions, Erdogan is paving the same path”.

On the same program, Mehmet Altan referred to “another structure” within the government that was closely watching the developments to “take its hand out of the bag”.

Prosecutors said that the comments were coded messages to followers of the cleric Fethullah Gulen, whom Ankara blames for orchestrating the coup.

“This sets a devastating precedent for scores of other journalists charged with similarly groundless charges,” said Sarah Clarke, of writers organization PEN International.

The lawyer for the Altan brothers said they would appeal against the verdict.

“This is a trial that wiped out freedom of thought,” Ergin Cinmen, the lawyer, told Reuters. “This verdict will be definitely reversed. Turkey cannot go on with this verdict.”