ISTANBUL (Reuters) - A Turkish court on Thursday overturned its decision to release the chairman of the local arm of Amnesty International, the rights group said, in a case that has caused international outrage.

An Istanbul penal court on Wednesday ordered the conditional release of Taner Kilic, who has been in prison since June on terrorism charges. Prosecutors say he downloaded ByLock, a messaging app allegedly used by followers of the Muslim cleric Turkey blames for a 2016 coup attempt.

Kilic, whose case attracted global attention and is seen by some as representative of a broad crackdown under President Tayyip Erdogan, was due to be released while the trial against him and 10 other human rights activists on terrorism-related charges continues. All 11 deny the charges.

The Istanbul court on Thursday reversed its decision after an appeal by a prosecutor, Amnesty said.

“To have been granted release only to have the door to freedom so callously slammed in his face is devastating for Taner, his family and all who stand for justice in Turkey,” Amnesty Secretary General Salil Shetty said in a statement.

“This is the latest example of the crisis in Turkey’s justice system that is ruining lives and hollowing out the right to a fair trial,” Shetty said, adding Kilic’s wife and daughters had waited all day by the prison gates to greet him.

The case against the 11 activists, who face up to 15 years in prison, has become a flashpoint in Turkey’s tense relations with Europe and heightened concern that an important NATO member is sliding further toward authoritarianism.

France called for Kilic’s immediate release.

“France is committed to the rights of everyone to a fair trial. We again call on Turkey to respect its European and international commitments on human rights and fundamental freedoms,” France’s Foreign Ministry said in a statement.

The prosecutor has set out a range of charges, including helping the outlawed Kurdistan Workers Party (PKK) and the network of U.S.-based cleric Fethullah Gulen.

Since the failed 2016 coup, which the government has blamed on Gulen, authorities have jailed more than 50,000 people and sacked or suspended more than 150,000. The government says such measures are necessary given the multiple security threats it faces.

Gulen, who has lived in self-imposed exile in the United States since 1999, has denied involvement and condemned the coup.