Joe Biden, the one-time Democratic presidential frontrunner, got emotional during a televised town hall Wednesday, when he was asked about his faith and how it would influence some of his decisions as president.

Rev. Anthony Thompson, an African-American Episcopalian pastor, asked the question during a South Carolina town hall on CNN. Thompson lost his wife in the June 2015 Emanuel AME Church massacre in Charleston.

Biden recalled serving as vice president at the time of the shooting carried out by a white supremacist that resulted in nine deaths.

He told the pastor that after visiting the church with then-President Obama and the first lady, he went a second time because he was going through his own personal loss. His son Beau Biden had just died from cancer.

Biden, no stranger to loss, told the pastor that visiting the church gave him a sense of hope. He quoted the Danish philosopher Søren Kierkegaard who said, “Faith sees best in the dark.”

Biden told the audience that his faith gives him hope and a sense of purpose. Besides the death of his son in 2015, he pointed to the death of his wife and daughter in 1972.

Biden was 30 years old when his wife and 13-month-old daughter were killed when their car was broadsided by a tractor-trailer. Biden told the Associated Press that they were picking out a Christmas tree at the time. The night before, he said his family surrounded the fireplace and his wife, Neilia, asked him, “What’s going to happen, Joey? Things are just too good.”

He told the audience that he managed to get through the pain by realizing that they continue to be part of  his "being."

"My son Beau is my soul," he said. Biden said he wakes up every morning and says to himself that he hopes Beau is proud of his work.

Beau Biden, a former Delaware attorney general, died after a two-year battle with brain cancer.

Obama remembered Beau Biden as a selfless son and consummate public servant in a eulogy delivered at the funeral.

GET THE FOX NEWS APP

"He did in 46 years what most of us couldn’t do in 146," Obama said. "He left nothing in the tank."

The Associated Press contributed to this report