The Christian pastor who was freed in a prisoner swap with Iran described his harrowing experience Monday in an “On The Record” exclusive with Fox News’ Greta Van Susteren.

Saeed Abedini was imprisoned in 2012 on charges of setting up home churches in the Islamic theocracy.

He told Van Susteren one of his most memorable moments was when he went before an Iranian judge on those charges.

“He said you are here because you want to use Christianity to remove government and it was like no, I don’t want to do that, I just came here to start orphanage, loving people and share the gospel with people and just that,” he said.

Abedini said the judge then told him he was using Christianity to “remove the government,” and yelled at him after saying he would pray for the judge.

According to Abedini, his Iranian captors gave him no clothing or reading material the entire time he was in the solitary confinement.

“Once they beat me very badly because they wanted me to write something I didn’t want,” he told Van Susteren.

He was also subject to the threat of death by his interrogators, and was taken to watch several executions.

“The worst thing I saw was when they took some Sunnis for execution, it was in front of our eyes, and they took like tens of them to hang, every Wednesday,” he said.

When he was imprisoned for 60 days with retired U.S. Marine Amir Hekmati, Abedini said he felt “very heartbroken” to see what happened when he first saw him, but said it was the best time in captivity to be with someone else.

“I made a plan that I could talk to him, encourage him,” he said. “The best thing I could do over there was praying.”