Pastor Andrew Brunson, center left, and his wife Norine Brunson arrive at Adnan Menderes airport for a flight to Germany after his release following his trial in Izmir, Turkey, Friday, Oct. 12, 2018, A Turkish court on Friday convicted an American pastor of terror charges but released him from house arrest and allowed him to leave Turkey, in a move that is likely to ease tensions between Turkey and the United. (AP Photo/Emre Tazegul)
Pastor Andrew Brunson, center left, and his wife Norine Brunson arrive at Adnan Menderes airport for a flight to Germany after his release following his trial in Izmir, Turkey, Friday, Oct. 12, 2018, A Turkish court on Friday convicted an American pastor of terror charges but released him from house arrest and allowed him to leave Turkey, in a move that is likely to ease tensions between Turkey and the United. (AP Photo/Emre Tazegul) Credit: ap — Emre Tazegul

Izmir, Turkey — An American pastor flew out of Turkey on Friday after a Turkish court convicted him of terror links but freed him from house arrest, removing a major irritant in fraught ties between two NATO allies still strained by disagreements over Syria, Iran and a host of other issues.

The court near the western city of Izmir sentenced North Carolina native Andrew Brunson to just over three years in prison for allegedly helping terror groups, but let him go because the 50-year-old evangelical pastor already had spent nearly two years in detention. An earlier charge of espionage was dropped.

Hours later, Brunson was transported to Izmir’s airport and was flown out of Turkey, where he had lived for more than two decades. He was to be flown to the U.S. military hospital in Landstuhl, Germany, then on to Washington, where he was to meet with U.S. President Donald Trump on Saturday.

“I love Jesus. I love Turkey,” an emotional Brunson, who had maintained he was innocent of all charges, told the court during Friday’s hearing. He tearfully hugged his wife Norine Lyn as he awaited the court decision.

“PASTOR BRUNSON JUST RELEASED. WILL BE HOME SOON!” Trump tweeted after the American was driven out of a Turkish prison in a convoy. Later, after Brunson was airborne, Trump told reporters the pastor had “suffered greatly” but was in “very good shape,” and that he would meet with him at the Oval Office on Saturday.

Brunson’s release was a diplomatic triumph for Trump, who is counting on the support of evangelical Christians for Republican candidates ahead of congressional elections in November.

It could also benefit Turkey, allowing the government to focus on an escalating diplomatic crisis over Jamal Khashoggi, a Saudi contributor to The Washington Post who went missing more than a week ago and is feared dead after entering the Saudi consulate in Istanbul. Turkish officials suspect Khashoggi was killed in the consulate; Saudi officials deny it.

Additionally, Turkey could now hope that the U.S. will lift tariffs on Turkish steel and aluminum imports.

While supporters in the United States celebrated Brunson’s release, his case overshadowed the predicament of a Turkish-American scientist from NASA and several Turkish workers for the U.S. diplomatic mission who were arrested in Turkey.