Speaking at the annual National Prayer Breakfast in Washington, Obama said that at a time of bitter partisanship, lawmakers must find a way to be open to the ideas of others, while staying true to their core principles.
"I pray that God will show me and all of us the limits of our understanding and open our ears and our hearts to our brothers and sisters with different points of view, that such reminders of our shared hopes and our shared dreams and our shared limitations as children of God will reveal a way forward that we can travel together," he said.
Obama's remarks Thursday built on his calls for civility in the days after last month's shooting rampage in Arizona, which left six dead. Rep. Gabrielle Giffords was shot in the head, and is recovering at a rehab center in Houston.
Giffords's husband, Mark Kelly, attended Thursday's breakfast and delivered the closing prayer.
"We are with them for the long haul, and God is with them for the long haul," Obama said of Giffords and Kelly.
The president said he also prayed that "a better day will dawn" over Egypt, where violence has erupted between supporters and opponents of President Hosni Mubarak.
"We pray that violence in Egypt will end, and the rights and aspirations of the Egyptian people will be realized," Obama said.
Religion has sometimes been a sensitive subject for Obama: He's faced persistent questions from some conservatives and political opponents who mistakenly believe Obama is a Muslim, not a Christian. In fact, a Pew Research Center poll in August found that 18 percent of people wrongly believe Obama is Muslim - up from 11 percent who said so in March 2009. Just 34 percent said they thought Obama is Christian.
Obama addressed those rumors in direct and personal terms Thursday, saying that his Christian faith has been a "sustaining force" during times when he and his family's religion been questioned.
"We are reminded that ultimately what matters is not what other people say about us, but whether we're being true to our conscience and true to our God," Obama said.
While Obama often speaks of his faith, he prefers to worship in private. He rarely attends church in Washington; the White House says his presence would be too disruptive to the congregation. Obama said Thursday that he starts his day with meditations from Scripture, and has pastors who often come to the Oval Office to pray with him.
The president said he had prayed for God's intervention on any number or occasions - though not always on the weightiest issues of the day.
At one point, the president said he has prayed, "Lord, give me patience as I watch Malia go to her first dance, where there will be boys. Lord, let her skirt get longer as she travels to that place." Twelve-year-old Malia is the older of his two daughters. Sasha is 9.