Turkey on Wednesday moved from jail to house arrest an American pastor who has spent almost two years imprisoned on terror-related charges, in a controversial case that has ratcheted up tensions with the United States.
Andrew Brunson, who ran a protestant church in the Aegean city of Izmir, was first detained in October 2016 and had remained in prison in Turkey ever since.
Mr Brunson's lawyer Cem Halavurt confirmed Turkish state media reports that his client was being put under house arrest, telling AFP he would be moved from prison later Wednesday.
Live pictures broadcast by the NTV channel in the late afternoon showed Mr Brunson being put into a vehicle outside prison and then driven away guided by a police motorbike escort.
The house arrest ruling was issued by a criminal court in the Izmir region where Mr Brunson was being held. He has also been banned from leaving the country.
Mr Brunson's detention had become a symbol of the problematic relationship between NATO allies Turkey and the US, and news of his release into house arrest boosted the Turkish lira, which gained almost one per cent in value against the dollar.
Mr Brunson still faces up to 35 years in jail if convicted on charges of carrying out activities on behalf of two groups Turkey deems terror organisations – one led by the US-based Muslim preacher Fethullah Gulen who Ankara says was behind a 2016 failed coup, the other the Kurdistan Workers' Party (PKK).
His next hearing is due to be on October 12.
The pastor denies the charges and his defence team argues the case is built on questionable witness statements that should never have been brought to court.
According to state news agency Anadolu, the ruling came after Mr Brunson's lawyer challenged the decision to keep him in prison on "health grounds".
But Mr Halavurt said that this was not true and that there is nothing official or paperwork to prove that Mr Brunson has health problems.
Mr Brunson is one of tens of thousands of people detained on similar charges during the state of emergency declared by President Recep Tayyip Erdogan in the wake of the 2016 failed coup bid.
The measure ended on July 18. But the Turkish parliament on Wednesday passed a new "anti-terror" law that strengthens the authorities' powers in detaining suspects and imposing public order.
The new law, strongly criticised by activists as essentially replacing the state of emergency, allows authorities to control who can enter and exit an area for 15 days for reasons of security.
Suspects can be held without charge for 48 hours or up to four days if there are multiple offences. This period can be extended on two occasions under special circumstances.
On July 18, a court had again ordered Mr Brunson to remain in prison, defying growing pressure from the US authorities for his release and causing dismay among supporters.
It was the third time his release has been refused – the court had in two previous hearings on April 16 and May 7 denied requests by the defence for Mr Brunson to be set free.
US President Donald Trump had described the latest ruling to keep him in jail a "disgrace", calling on his Erdogan to help free him.
Philip Kosnett, the US charge d'affaires in Ankara, who attended all three hearings, said last week he did not believe "there is any indication that pastor Brunson is guilty of any sort of criminal or terrorist activity."
Prominent US lawyer Jay Sekulow, who has worked with the Mr Brunson defence, welcomed the move on Twitter as a "critical first step that we believe will result in the freedom" of Mr Brunson.
Turkish-US relations are already strained over Washington's refusal to extradite Mr Gulen as well as American backing for a Kurdish militia in Syria which Turkey says is linked to the PKK.
Two Turkish employees from American missions in Turkey are also behind bars – a US Istanbul consulate staffer charged with espionage and an employee at the US consulate in Adana charged with supporting the PKK.
Turkish-American NASA scientist Serkan Golge was also jailed for seven-and-a-half years for being a member of Gulen's movement earlier this year.
Last September, Mr Erdogan suggested that Turkey could free Mr Brunson if Washington handed over Mr Gulen, who lives in self-imposed exile in Pennsylvania – an offer brushed off by Washington.
A senior US official said last week that suggestions by "very senior" figures in Turkey to link the cases had added to the tensions in the relationship.