He acknowledged questions about his faith.
"My Christian faith, then, has been a sustaining force for me over these last few years, all the more so when Michelle and I hear our faith questioned from time to time," he said to a crowd of about 4,000 at the Washington Hilton hotel. "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. 'Seek first his kingdom and his righteousness, and all these things will be given to you, as well.' "
NASA astronaut Mark Kelly, the husband of Rep. Gabrielle Giffords (D-Ariz.), seriously injured during the Tucson shooting rampage last month, also spoke briefly at the breakfast and gave the closing prayer.
The National Prayer Breakfast is a decades-old Washington event attended by members of Congress who are in prayer groups, as well as faith activists and professionals from across the spectrum. Presidents have been addressing the largely evangelical group each year since 1953.
Obama spoke frequently of his Christianity as both a candidate and a senator, but since becoming president his lack of public worship service attendance has become a matter of some attention.
Some high-profile religious conservatives have raised the question, while some religious progressives have criticized Obama for not framing his policy priorities through a religious lens. The president's supporters have noted that President Bush did not attend church regularly while in office either.
It's unclear whether - or how - Obama's handling of the subject affects his political standing, as the last several elections have shown a strong divide on voting regardless of the candidates: people who attend church more frequently, particularly evangelical Christians, tend to back Republicans, while Democrats have more support among voters who rarely attend services.
Meanwhile, many other Americans have bristled at the idea that America's leader needs to have a religious faith, or a faith of a particular kind. They question why the president and Congress would gather at such a high-profile religious event. Obama made clear Thursday he's not in that camp.
"For almost 60 years, going back to President Eisenhower, this gathering has been attended by our president. It's a tradition that I'm proud to uphold, not only as a fellow believer, but as an elected leader whose entry into public service was actually through the church."
The president spoke Thursday about his prayers.
"As I travel across the country, folks often ask me, what is it that I pray for? And like most of you, my prayers sometimes are general. Lord, give me the strength to meet the challenges of my office. Sometimes they're specific. Lord, give me patience as I watch Malia go to her first dance, where there will be boys."
Turning more serious, he listed ministers he prays with such as Joel Hunter, the pastor of a megachurch in Florida.
Obama had been largely private about his beliefs and religious practices, following controversies during the campaign about his Chicago minister.
He and his wife have been to church services in Washington only a handful of times in the past two years, though they attend the private Evergreen Chapel when they are at Camp David. White House officials have issued statement after statement about the private nature of his Christian faith.
In his speech Thursday, he detailed what he prays for in a way he rarely has as a candidate or as president, and used meatier spiritual language of the type typically heard in evangelical churches
"When I wake in the morning, I wait on the Lord, and I ask him to give me the strength to do right by our country and its people," he said.
"And when I go to bed at night, I wait on the Lord, and I ask him to forgive me my sins and look after my family and the American people and make me an instrument of his will."
He distanced himself from his father - who was born Muslim - saying he "only met him once for a month in my entire life" but said his mother, while skeptical of organized religion, "was one of the most spiritual people I ever knew." The president characterized this spirituality not as one about a personal relationship with God, or about ideas about salvation or the Bible, but rather about basic ethics.
"She was somebody who was instinctively guided by the golden rule and who nagged me constantly about the homespun values of her Kansas upbringing, values like honesty, and hard work, and kindness, and fair play."
The president remains relatively unpopular among white evangelicals, 68 percent of whom in the most recent Post-ABC poll said they disapprove of how he is doing his job. That's about what his rating was on average in 2010 and significantly worse than it was at the start of his term. Seventy-three percent of white evangelicals voted for John McCain in 2008.
However Obama's approval rating among white Catholics - a key swing group - topped 50 percent for the first time in a year in the recent poll. After reading a career low of 39 percent approval among this group in September, he is now at 51 percent positive.
In his brief remarks, Kelly said, "I hadn't been a big believer in fate until recently. I thought the world just spins and the clock just ticks and things happen for no particular reason."
He said he has come to believe, however, that things happen for a reason, "that maybe something good can come from all of this."
Kelly said his wife's health continues to improve. She was recently moved to a rehabilitation center in Houston.
MORE COVERAGE: On Faith Analysis: Obama at National Prayer Breakfast
email@example.com firstname.lastname@example.org Washington Post On Faith Editor Elizabeth Tenety, Director of Polling Jon Cohen and staff writer Sandhya Somashekhar contributed to this report.