As the months dragged on while Turkey kept American pastor Andrew Brunson in a jail cell, his thoughts started drifting to a dark place.

Brunson, who recently returned to the United States after two years of incarceration, described his efforts to maintain his sanity.

“It seemed that there was no way out,” he told Fox News host Sean Hannity on Tuesday evening. “And I lost a lot of hope. And what helped me — I began to see there was value in my suffering, especially as time went on. I saw that many people around the world began praying for me.”

It was his wife and God who got him through the ordeal, Brunson said.

The evangelical pastor said his wife was his only contact with the outside world. Turkish authorities allowed her to see her husband through glass for half an hour each week.

“She would bring encouragement to me and tell me that people are praying for me,” he said. “And as I learned that, I began to see that God was involved in this and that God was going to do something with my suffering.”

“I began to see that God was involved in this and that God was going to do something with my suffering.”

Brunson found himself in the wrong place at the wrong time after Turkish strongman Recep Tayyip Erdoğan survived a coup attempt in 2016.

Suddenly, Brunson (pictured above) was in custody, charged with terrorism and aiding the overthrow of the government. The charges were false, Brunson said, and a bit disorienting.

“The truth is, we had been preaching Jesus Christ, sir. That’s why we were in Turkey for 23 years, up until that time — to share the Gospel of Jesus Christ with Turks,” he said. “We’d done that openly and never had a problem. So it was very shocking to be accused of terrorism.”

Brunson told Hannity it was difficult being the only Christian in the jail. But he said his fellow prisoners treated him well.

Who do you think would win the Presidency?

By completing the poll, you agree to receive emails from LifeZette, occasional offers from our partners and that you've read and agree to our privacy policy and legal statement.

Related: Freed American Pastor Andrew Brunson Prays with President Trump in the Oval Office

“Part of that time, it was a very crowded cell. And part of the time, I was also in isolation,” he said. “So it was a very difficult time, and I was surprised, because I had never really considered prison as a possibility.”

Brunson’s detention became a sore spot in increasingly deteriorating relations between the United States and its North Atlantic Treaty Organization (NATO) ally. Evangelical leaders took up his cause.

Erdoğan tried and failed to broker a deal exchanging Brunson for Fethullah Gülen, an Islamic preacher accused of supporting the coup attempt. He has been living in exile in the United States.

President Donald Trump’s administration imposed sanctions on Turkey in August.

A Turkish court last week convicted Brunson of aiding terrorism but sentenced him to time served and released him.

A grateful Brunson returned home and this past weekend prayed over Trump at the White House.

Brunson’s explanation of his motivation was simple: “Our president needs prayer,” he said.