ISTANBUL/ANKARA (Reuters) - Turkey said on Friday the case of two journalists held for more than a year over alleged ties to a failed coup would be decided by a local court, after the Constitutional Court ruled they be freed, a turnaround likely to deepen concerns for press freedom.

FILE PHOTO - Turkish Prime Minister Binali Yildirim speaks during a joint news conference with his Greek counterpart Alexis Tsipras after their meeting at the Maximos Mansion in Athens, Greece, June 19, 2017. REUTERS/Costas Baltas

The Constitutional Court, Turkey’s highest, ruled on Thursday in favor of freeing the two journalists, Mehmet Altan and Sahin Alpay, on the grounds that their rights had been violated while in custody. Hours later, penal courts decided to keep them in detention.

The reversal by the lower courts may stir further worries about media freedom and judicial independence in Turkey in the aftermath of a widespread crackdown. Authorities have shut about 130 media outlets since the failed coup in July 2016. The Turkish Journalists’ Association says about 160 journalists are in jail, most held since the putsch.

“Whether we like the Constitutional Court’s ruling or not, the authority that will make the right call is the first instance court,” Prime Minister Binali Yildirim said, referring to the local court.

“Whichever court it is that is making the decision, our expectation from them is to not make decisions that will hinder the battle against FETO,” he said, referring to the network of Muslim cleric Fethullah Gulen, accused by Ankara of plotting the coup. U.S.-based Gulen denies involvement in the coup.

Earlier on Friday Deputy Prime Minister Bekir Bozdag said the top court had overstepped its limit.

“When ruling on individual applications, the Constitutional Court... cannot act like a super appeals court and cannot make rulings like such courts,” Bozdag wrote on Twitter.

“The Constitutional Court has overstepped the limit set out in the constitution and the laws,” he said.

Altan and Alpay were accused of links to terrorist groups and attempting to overthrow the government and were among more than 50,000 people remanded in custody after the failed putsch. They deny the charges.

SECURITY THREAT

“This is a typical situation that shows that not a trace of justice remains in Turkey,” said Turgut Kazan, the former head of the Istanbul bar.

Turkey says its sweeping measures are necessary, given the extent of the security threats it faces. Its Western allies, particularly in Europe, have voiced concern that President Tayyip Erdogan is using the coup as a pretext to stifle dissent.

European Commission President Jean-Claude Juncker on Friday said the EU and Turkey would see no progress in their relations as long as Ankara keeps journalists in prison.

Erdogan has previously criticized similar rulings by the Constitutional Court. In 2016 he said a ruling that led to the release of prominent editor Can Dundar and another detainee hurt Turkey and warned that a repeat of such actions could bring the court’s very existence into question.

Separately, Turkey reinstated more than 1,800 civil servants purged after the failed coup, determining they had no links to Gulen’s network, state-run Anadolu news agency said on Friday.

Last year, prosecutors said they would review legal cases against more than 11,000 people accused of using the ByLock messaging app, finding that some suspects had unintentionally used it after being linked to it from another app.

Turkey outlawed ByLock after the attempted putsch, saying followers of Gulen used it to communicate on the night of July 15, 2016, when rogue soldiers commandeered tanks and warplanes to attack parliament, killing more than 240 people.