The court on Friday sentenced Andrew Brunson to three years and 1-1/2 months in jail on terrorism charges, but released him after taking into account time served and good conduct.
The pastor was detained two years ago and has been under house arrest in the city of Izmir since July, Presstv Reported.
Brunson, 50, was indicted by a Turkish court on charges of having links with the Kurdistan Workers’ Party (PKK) militant group and the movement of the US-based opposition cleric Fethullah Gulen, whom Ankara accuses of having masterminded the July 2016 coup attempt against President Recep Tayyip Erdogan. Brunson has already denied the charges.
His detention sparked a widening rift between Turkey and the US. Washington called for Brunson’s release and taken a series of punitive measures against Turkey over the continued detainment of the evangelical Christian pastor.
The US measures, which include imposing sanctions on Turkish ministers and doubling of steel and aluminum tariffs, have led to a sharp decline in the Turkish currency. Turkey has retaliated by raising tariffs on certain US imports.
After the ruling, Brunson's lawyer said the pastor was likely to leave Turkey.
Trump: Brunson ‘will be home soon’
US President Donald Trump, who has imposed sanctions on Turkey in an attempt to put pressure on the country to release Brunson, tweeted: "PASTOR BRUNSON JUST RELEASED. WILL BE HOME SOON!"
Brunson said in a statement on Friday that he was heading home soon.
"This is the day our family has been praying for -- I am delighted to be on my way home to the United States."
He also voiced gratitude to Donald Trump, saying "My entire family thanks the president, the administration, and Congress for their unwavering support."
American officials were quoted as saying that the US military has a plan to fly the pastor back to America on a military aircraft.
US broadcaster NBC said on Thursday that Turkey and the US had reached a secret deal to secure Brunson’s release.
But Turkey said its judiciary is independent and US State Department spokeswoman Heather Nauert said she was "not aware" of any such settlement.
Turkey and the US also disagree over their military interventions in the Syria war, Ankara's plan to buy missile defense systems from Russia and the US conviction of a Turkish state bank executive on sanctions-busting charges in January.