Turkish court orders release of journalist Mehmet Altan

ANKARA (Reuters) - A Turkish court has ruled that journalist Mehmet Altan be released, four months after he was jailed for life on charges of aiding plotters behind a failed military coup, a court ruling seen by Reuters showed.

Altan and his brother, Ahmet, were detained in September 2016 as part of a government crackdown in the aftermath of the coup attempt against President Tayyip Erdogan. They were imprisoned for life in February with four other journalists.

Mehmet Altan was sentenced even though the constitutional court, Turkey's highest, had previously ruled for his release, saying that his detention amounted to a violation of his rights. A penal court rejected the request and decided to keep him in jail as his trial continued.

"It was an absurd situation and totally unlawful for him not to be released after the Constitutional Court decision," a lawyer for Altan, who declined to be named, told Reuters.

"Another court, the appeals court, did the right thing and released him now. That's what should have happened in the first place," the lawyer said, adding that Altan was expected to be released from prison later on Wednesday.

Altan's case underscored deep concern about press freedom in Turkey as well as worries over the independence of the judiciary under Erdogan, who was re-elected on Sunday to a newly empowered executive presidency.

The court ruled for the other five defendants in Altan's case to be remanded in jail, the ruling showed.

Since the coup attempt, more than 50,000 people have been jailed and 150,000 sacked or suspended from their jobs.

More than 120 journalists have been detained and over 180 media outlets closed on suspicion of links to the network of U.S.-based cleric Fethullah Gulen, blamed for organising the abortive attempt to topple the government. He denies any connection with the would-be coup.

Ahmet Altan was charged over comments he made the day before the July 2016 coup attempt, when he told a television show: "Whatever the developments were that led to military coups in Turkey, by making the same decisions, Erdogan is paving the same path".

On the same programme, his brother Mehmet referred to "another structure" within the government that was closely watching the developments to "take its hand out of the bag".

Prosecutors said that these comments were coded messages to Gulen's followers to take action.