Years before he was taken into captivity by ISIS (Islamic State) and eventually put to death, journalist James Foley wrote about his prayer experience while being taken captive in Libya.

Foley was reporting in Libya in 2011 when he was captured by forces that were serving Muammar Gaddafi. While being held, he prayed with another captive saying 100 Hail Marys. He said that the prayers helped keep him focus and gave him and the other captive strength.

"I began to pray the rosary. It was what my mother and grandmother would have prayed," Foley wrote in a letter published in Marquette Magazine. "I said 10 Hail Marys between each Our Father. It took a long time, almost an hour to count 100 Hail Marys off on my knuckles. And it helped to keep my mind focused."

Foley is a graduate of Marquette University.

Eighteen days into their captivity he was allowed to make a call to his mother, when she told him that all his family and friends were praying for him back in the States.

"Mom, Mom, it's me, Jim."

"Jimmy, where are you?"

"I'm still in Libya, Mom. I'm sorry about this. So sorry."

"They're having a prayer vigil for you at Marquette. Don't you feel our prayers?" she asked.

"I do, Mom, I feel them," and I thought about this for a second. Maybe it was others' prayers strengthening me, keeping me afloat.

Foley credited prayer as the adhesive to his freedom, freeing him first in his own heart and then from his captors who had no advantage in letting him go.

While the American journalist was eventually freed in Libya, his capture by ISIS while reporting in Syria on Nov. 22, 2012, according to reports by the FBI, was fatal.

In an explicit video released this week, ISIS jihadists claimed beheading 40-year-old Foley as retaliation for the air strikes President Obama ordered in Mosul to assist the Iraqi and Kurdish forces there. At the end of the video ISIS showed another American captive that they threaten to be next to die if the U.S. continues its affront on the group.