October 12 at 9:35 AM

 A Turkish court convicted American pastor Andrew Brunson of aiding terrorism on Friday but sentenced him to just time served and ordered his immediate release.

The case of the evangelical preacher caught up in Turkey’s post-coup security sweep had garnered the attention of the highest levels of the American administration and become a sore point in the two countries’ relations.

Brunson’s trial had resumed Friday in western Turkey, where he headed a small evangelical congregation, just hours after U.S. officials said that a deal had been reached with Turkish authorities to secure his release.

Brunson, 50, has been held for two years on what he and the Trump administration said were false terrorism- and espionage-related charges. Prosecutors accused the pastor of being linked both to Kurdish separatists and the U.S.-based Muslim cleric Turkish authorities say orchestrated a failed coup attempt in 2016.

Brunson was released on house arrest in July due to health reasons but his ongoing trial has helped deepen a rift between Turkey and the United States, already at odds over the latter’s support for Kurdish-led fighters battling the Islamic State in Syria.

Vice President Pence took a particular interest in Brunson’s case and has helped mobilize Trump’s evangelical political base to the cause.

N.C. pastor Andrew Brunson is on trial in Turkey after being accused of associating with plotters of a 2016 coup attempt against President Recep Tayyip Erdogan. 

In recent months, the administration made Brunson’s release a priority, and in August, the United States imposed sanctions on two senior Turkish cabinet ministers as a way to pressure authorities here.

Turkish President Recep Tayyip Erdogan had said that his government could not interfere in a judicial case. But U.S. officials said Thursday that an agreement between the two sides to free Brunson was negotiated on the sidelines of the U.N. General Assembly last month.

The deal, they said, would include the lifting of U.S. sanctions in exchange for reduced charges that would allow Brunson to either be sentenced for time served or serve any remaining sentence in the United States.

Turkish prosecutors had sought a 35-year sentence for Brunson, who they accused of spying and supporting terrorists under the cover of humanitarian aid and interfaith dialogue. That request was later reduced to 10 years at the trial.

He was swept up in the wave of arrests that followed the botched military coup in 2016, during which tens of thousands of people — including artists, intellectuals and ordinary Turks — were detained. But prosecutors also alleged he supported members of the Kurdistan Workers’ Party, or PKK, which has waged a decades-long insurgency against the Turkish state.

The PKK is a staunchly secular and leftist organization. The indictment against Brunson quotes a witness as saying congregants at Brunson’s Resurrection Church in Izmir province wore the “flags and pennants of the PKK terrorist organization.”

But at the courthouse in Izmir’s Aliaga district Friday, a series of witnesses for the prosecution, including one who appeared via video conference, gave scattered and at times contradictory testimony.

One witness, Levent Kalkan, said that investigators misunderstood his original testimony that had implicated Brunson in harboring coup suspects in 2016.

The man that Kalkan has said witnessed the protection of the fugitives appeared in court Friday to say that he had seen no such thing.

“I never told Levent that,” the witness, Yilmaz Demirjan, said.

Brunson, who sat alone in front of a panel of judges and the state prosecutor, was also allowed to speak following each witness’s testimony.

“I never met any PKK fighters,” he said to the judges in Turkish.