Asked about people who question the sincerity of his faith, Obama responded: "You know, there's not much I can do about it. I have a job to do as president, and that does not involve convincing folks that my faith in Jesus is legitimate and real."
Answering the same question, Romney said: "I am often asked about my faith and my beliefs about Jesus Christ. I believe that Jesus Christ is the Son of God and the Savior of mankind. Every religion has its own unique doctrines and history. These should not be bases for criticism but rather a test of our tolerance."
Both men said that political candidates should be judged by their works, not faith.
"A political leader's faith can tell us a great deal or nothing," Romney said. "So much depends on what lies behind that faith. And so much depends on deeds, not words."
Both men also said religion is central to their lives.
"My Christian faith gives me a perspective and security," Obama said, "that I don't think I would have otherwise: That I am loved. That, at the end of the day, God is in control."
Romney said "faith is integral to my life. I have served as a lay pastor in my church. I faithfully follow its precepts."
The men differed slightly on the role of faith in public life.
Obama highlighted religion's contributions to the suffrage, abolition and civil rights movements. He also said that faith provides a "moral framework and vocabulary" for the country in times of crisis.
Romney said the country should "acknowledge the creator, as did the Founders in ceremony and word." God, he added, should remain present in American currency, the Pledge of Allegiance and history lessons, as well as nativity scenes and menorahs in public places.
"In recent years, the notion of the separation of church and state has been taken by some well beyond its original meaning," Romney said. "They seek to remove from the public domain any acknowledgment of God."