A Turkish court has sentenced six defendants, including three prominent journalists, to life in prison over allegations of involvement in a 2016 coup attempt, drawing fierce condemnation from the UN and press freedom advocates.

The convictions followed a months-long trial during which the prosecution alleged that the journalists sent “subliminal messages” via TV appearances and newspaper columns urging the overthrow of the government, and that they maintained contact with members of the Fethullah Gülen network, a movement widely believed in Turkey to have orchestrated the coup attempt.

The first conviction of media figures in relation to the failed putsch constitutes a major defeat for press freedom in the Nato member state, which has cracked down on dissent in the aftermath of the coup. At least 73 journalists remain behind bars, according to the Committee to Protect Journalists, which ranks Turkey the world’s worst jailer of journalists, ahead of China and Egypt.

Fethullah Gülen: who is the man Turkey's president blames for coup attempt? Read more

The prominent journalists handed life sentences were the brothers Ahmet Altan and Mehmet Altan, who have been detained since 2016, and Nazlı Ilıcak. The conviction defies an order by Turkey’s highest court to release Mehmet Altan, after it found last month that his imprisonment had violated his constitutional rights.

“The court decision condemning journalists to aggravated life in prison for their work, without presenting substantial proof of their involvement in the coup attempt or ensuring a fair trial, critically threatens journalism and with it the remnants of freedom of expression and media freedom in Turkey,” said David Kaye, the United Nations special rapporteur on freedom of opinion and expression.

Sarah Clarke, the policy and advocacy manager for the writers’ association PEN International, tweeted that the sentences marked an “apex of the disintegration of the rule of law in Turkey. “This sets a devastating precedent for scores of other journalists charged with similarly groundless charges,” Clarke wrote.

The International Press Institute said it was appalled by the verdict.

Ilıcak, 73, was one of the very first journalists arrested in July after the coup attempt. Briefly an MP from 1999, she wrote for several daily newspapers including Hurriyet. Ahmet Altan, 67, is a novelist and journalist who has written for some of papers including Hurriyet and Milliyet as well as founding the now closed opposition daily Taraf. Mehmet Altan, 65, has written books on Turkish politics.

The court also handed down life sentences to Yakup Şimşek, a former marketing manager for the Gülen-affiliated Zaman newspaper, Zaman layout designer Fevzi Yazıcı, and police academy instructor Şükrü Tuğrul Özsengül. Gülen has denied any links to the coup attempt.

The sentencing came on the same day another Turkish court ordered the release of Deniz Yücel, 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 and highlighted the precarious state of press freedom in Turkey.

A criminal court in Istanbul decided to release Yücel pending a trial after prosecutors said they had completed their investigation into the journalist. The court accepted the indictment filed by prosecutors, who are seeking an 18-year prison sentence over allegations of spreading propaganda on behalf of a terrorist organisation.

The order to release him was confirmed by the state-run Anadolu Agency, the German foreign minister, and Yücel’s lawyer, Veysel Ok, who tweeted a photograph of Yücel embracing his wife after he was freed.

The Die Welt correspondent was detained on 14 February 2017 after going to an Istanbul police station for questioning. He got married in prison and spent months in solitary confinement at Silivri maximum security prison outside Istanbul. He spent 366 days in detention without formal charges.

Yücel’s detention came amid a deep rift in relations between Germany and Turkey. Berlin barred Turkish ministers from holding rallies in Germany with Turkish citizens ahead of a referendum on presidential powers, and condemned growing authoritarianism under the leadership of Recep Tayyip Erdoğan, who in turn has condemned rising Islamophobia in Europe. Talks on Turkey’s future membership of the EU have been stalled for years.