US pastor Andrew Brunson. Photograph:( Reuters )
Brunson was arrested on the charges of having links with Kurdish militants and supporters of Fethullah Gulen, the cleric who is blamed by Turkey for a failed coup attempt in 2016.
A Turkish court on Friday ordered the release of an American pastor held for the last two years in Turkey.
The court in the western town of Aliaga convicted Andrew Brunson on terror-related charges and sentenced him to three years, one month and 15 days in jail.
However, he was freed taking into account time served and his good conduct in the trial, with the court lifting his house arrest and overseas travel ban.
"I am an innocent man. I love Jesus. I love Turkey," Brunson said in his final defence.
When the verdict was read out, he wept and hugged his wife Norine.
It was not immediately clear where Brunson would go next, although some reports suggested he could fly to the United States imminently.
Brunson was arrested in 2016 on the charges of having links with Kurdish militants and supporters of Fethullah Gulen, the cleric who is blamed by Turkey for a failed coup attempt.
He has been under arrest in Turkey for the past two years.
Brunson had earlier denied the accusations and Washington had demanded his immediate release.
A Turkish prosecutor on Friday asked a court to end the house arrest and foreign travel ban of Brunson.
The prosecutor requested that Brunson be sentenced to up to 10 years in jail on charges of membership of a terror group, state-run TRT Haber TV said.
But crucially, the prosecutor had also requested that the court lifts the house arrest and travel ban of Brunson.
Meanwhile, the witnesses that were presented in the court claimed that the previous testimonies attributed to them against an American pastor were inaccurate.
In the wake of the detention of the US pastor, the US had imposed tariffs against Turkey.
With Washington slapping sanctions on Ankara, the crisis also sparked a crash in the Turkish lira in August that exposed Turkey's economic fragility.
Brunson appeared in the courtroom in the western coastal town of Aliaga wearing a black suit, white shirt and red tie. His wife Norine looked on from the visitors' seating area as he listened to testimony from defence and prosecution witnesses.
Brunson's detention deepened a rift between NATO allies Washington and Ankara, who are also at odds over the Syrian war and Turkey's plan to buy missile defences from Russia. The row has also exacerbated a slide in the lira's value which has lost 40 per cent against the dollar this year.
(With inputs from agencies)