A US pastor detained in Turkey for almost two years is to leave prison and move to house arrest until his trial, a court has ruled.
Andrew Brunson was arrested in October 2016 for aiding an organisation led by exiled preacher Fethullah Gulen - which Turkey regards as a terrorist group.
Turkey blames Mr Gulen for a failed coup attempt against President Recep Tayyip Erdogan that year.
State media report that almost all the evidence for the case has been collected.
US Secretary of State Mike Pompeo welcomed the decision, but said on Twitter that it was "not enough" and that there was "no credible evidence" against the pastor.
We welcome long overdue news that Pastor Brunson has been moved from prison to house arrest in #Turkey, but it is not enough. We have seen no credible evidence against Mr. Brunson, and call on Turkish authorities to resolve his case immediately in a transparent and fair manner. pic.twitter.com/So2A4hfinZ— Secretary Pompeo (@SecPompeo) July 25, 2018
Turkey's case against Mr Brunson has strained relations with its Nato allies and drawn fire from US President Donald Trump.
A total disgrace that Turkey will not release a respected U.S. Pastor, Andrew Brunson, from prison. He has been held hostage far too long. @RT_Erdogan should do something to free this wonderful Christian husband & father. He has done nothing wrong, and his family needs him!— Donald J. Trump (@realDonaldTrump) July 19, 2018
US support for Kurdish forces fighting the Syrian civil war and its refusal to extradite Mr Gulen have angered President Erdogan, while Turkey's decision last year to buy Russian anti-aircraft missiles drew controversy.
State media say the court in the western city of Izmir decided that he should be released on health grounds.
Cem Halavurt, a lawyer for Mr Brunson, confirmed he was to be placed under house arrest, and would have to wear an electronic ankle bracelet.
He called the charges against his client "totally unfounded".
Mr Brunon has lived in Turkey for 23 years and worked as a Protestant pastor at the Izmir Resurrection Church.
He became one of more than 50,000 people arrested as part of President Erdogan's huge crackdown following the coup attempt.
Prosecutors say Mr Brunson worked with a group led by Mr Gulen, who is living in exile in Pennsylvania, as well as with the Kurdistan Workers' Party (PKK).
Mr Gulen has denied any involvement in the attempted coup. The European Union has said it does not share Turkey's view that his network is a terror organisation.