On Friday, a Turkish court ruled that American pastor Andrew Brunson will be released from prison and sentenced to time served.

Agence France-Press (AFP) broke the story. “Turkey: Lifting of the house arrest and travel ban of Pastor Brunson,” AFP tweeted.

Turquie : levée de l'assignation à résidence et de l'interdiction de voyager du pasteur #Brunson (#AFP) — Agence France-Presse (@afpfr) October 12, 2018

As the news broke, President Donald Trump tweeted, “Working very hard on Pastor Brunson!”

Working very hard on Pastor Brunson! — Donald J. Trump (@realDonaldTrump) October 12, 2018

Trump later celebrated the news in a follow-up tweet. “PASTOR BRUNSON JUST RELEASED. WILL BE HOME SOON!” the president declared.

PASTOR BRUNSON JUST RELEASED. WILL BE HOME SOON! — Donald J. Trump (@realDonaldTrump) October 12, 2018

The news came after Trump officials secured a secret deal with Turkey regarding Brunson’s release, two years after he was arrested. The deal reportedly involves easing economic sanctions on Turkey.

Trump personally called upon Turkish President Recep Tayyip Erdoğan to release Brunson in July, after the pastor was denied release in a trial hearing. Turkish authorities had charged him with terrorism.

According to reports on Friday, the Turkish court sentenced him to time served and ordered his immediate release.

BREAKING: Turkish court convicts American pastor Andrew Brunson of `terror' charge but releases him from house arrest. — The Associated Press (@AP) October 12, 2018

Tony Perkins, president of the Family Research Council and a member of the U.S. Commission on International Religious Freedom, attended Brunson’s hearing and congratulated President Trump on the release.

“The prayers of thousands were answered today when Pastor Brunson was released by the Turkish government and told he could go home to the United States,” Perkins said in a statement. “Those prayers combined with the unwavering resolve of President Trump, Vice President Pence, Secretary Pompeo and Ambassador Brownback brought tangible help to Pastor Brunson and hope to those around the globe who are being persecuted because of their faith.”

Follow the author of this article on Twitter at @Tyler2ONeil.