BEAUFORT, S.C. — Newt Gingrich was confronted over his extramarital affairs at a campaign rally late Thursday morning, asked by a man who called him a “very inspiring” candidate how he would explain his “lapses in judgment” to voters.

The former House Speaker said he’d already discussed the matter but, in his response, emphasized his closeness to his daughters and the fact that he is a grandfather.

“This is a decision you have to make,” he said. “I’ve been very open about my life. I’ve been very open about the mistakes that I have made. I was very open about needing to go to God for forgiveness and seeking reconciliation. Callista and I have a wonderful relationship, we are very close to our two daughters and their husbands. We’re very close to our two grandchildren, Maggie and Robert.”

He added that he expects these questions to come on the campaign trail, and said he decided the campaign was worth it.

“I am 68 years old. I am a grandfather. We entered this race, and we had to think this through for a year because we knew we’d get beaten up, we knew we’d get lied about, we knew we’d get smeared, we knew there’d be nasty attack ads — and we decided the country was worth the pain,” he said. “Now people have got to decide.”

The issue of Gingrich’s extramarital affairs and divorces has been brought back to the center of attention by an interview one of his ex-wives, Marianne Gingrich, gave to ABC News. She said that when she confronted Gingrich during their marriage about his six-year affair with his now-wife, Callista, he asked for an “open marriage.”

Gingrich is in a tight race with Mitt Romney in South Carolina. But to win he will need to unite the large evangelical Christian voting bloc behind his campaign, and his infidelities have been mentioned by many social conservatives in the state as the reason they’re hesitant to support him.

Rick Perry, who exited the presidential race Thursday, endorsed Gingrich.

“Newt is not perfect, but who among us is?” the Texas governor said.