President Barack Obama says his religious faith and values help guide him in setting his policies.

At the National Prayer Breakfast, an annual gathering of several thousand leaders from numerous religions, President Obama said faith and values are important in setting the nation's policies.

"In my moments of prayer, I am reminded that faith and values play an enormous role in motivating us to solve some of our most urgent problems," he said.

The president said his call for wealthy Americans to pay higher taxes is particularly based in teachings which are common to several religions.

"It also coincides with Jesus' teaching that 'For unto whom much is given, much shall be required.' It mirrors the Islamic belief that those who have been blessed have an obligation to use those blessings to help others, or the Jewish doctrine of moderation in consideration for others," Obama added.

Some analysts see the president's comments as an indirect slap at Republican presidential candidate Mitt Romney, who said Wednesday that his main economic concern is for America's middle class. Romney said there are government programs in place to help the poor.

"I am not concerned about the very poor. We have a safety net there. If it needs repair, I will fix it," he said. "I am not concerned about the very rich. They are doing just fine. I am concerned about the very heart of America - the 90 to 95 percent of Americans who right now are struggling, and I will continue to take that message across the nation."

At the prayer breakfast, Obama also said his religious beliefs guide his foreign policy. He mentioned his opposition to cuts in U.S. foreign aid, and his campaigns against atrocities in Uganda and human trafficking throughout the world.

"It is not just about strengthening alliances, or promoting democratic values, or projecting American leadership around the world, although it does all those things and it will make us safer and more secure. It is also about the biblical call to care for 'the least of these,' for the poor, for those at the margins of our society," Obama noted.

The president, whose Kenyan grandfather was a Muslim, said he grew up in a nonreligious household and went through a period of doubt and confusion before embracing Christianity. He said he regularly asks God for guidance in both his personal life and his work as president.