President Obama speaks at the National Prayer Breakfast in Washington, Thursday, Feb. 4, 2016. The annual event brings together U.S. and international leaders from different parties and religions for an hour devoted to faith. (AP Photo/Pablo Martinez Monsivais)

President Obama  in his remarks Thursday at the National Prayer Breakfast returned to two emotions that have dominated the last few months of his White House tenure: fear and anger.

The president described the fear that has coursed through the country since the Paris and San Bernadino terrorist attacks and the anger that has dominated the presidential elections. He didn’t mention any candidates by name, but his remarks reflected his growing concerns for a segment of the country that is increasingly drawn to the loudest and angriest voices.

Obama has raised these worries, of late, in remarks from the Oval Office, at last month’s State of the Union address and on Wednesday at a mosque outside Baltimore.

“Fear does funny things,” Obama said. “Fear can lead us to lash out against those who are different or try to get some sinister other under control. It can lead us to succumb to despair or paralysis or cynicism.”

The president spoke of fear’s tendency to “feed our most selfish impulses” and erode the bonds of trust that hold societies together. He warned that it could spread not just within countries but also across the globe.

“It is primal and contagious,” he said. “If we let it consume us, the consequences of that fear can be worse than any outside threat.”

Obama has used the prayer breakfast to challenge attendees or, in the opinion of some Republican critics, stir controversy. At last year’s breakfast Obama, citing the Crusades, noted that Christianity, like Islam, had been used in the past to justify violence against those of different beliefs. Some Republicans saw the remarks as drawing a false equivalence between Islamic State atrocities and those committed by Christians centuries earlier.

This year Obama sought to diagnose the causes of fear and frustration that seem to be consuming the country he leads. He described “tectonic shifts” in the American economy, an unceasing media that “feeds our ever-shrinking attention spans” and the gap between rich and poor at home and abroad.  “That gap between want and plenty gives us vertigo,” he said. “It makes us afraid. It makes us that progress will stall and we’ll have more to lose.”

Obama described the power of God’s love as the best antidote to the fear and uncertainty that seemed to be gripping the country. The president’s remarks echoed many of the themes from his speech delivered a day earlier during his first visit as president to an American mosque.

God’s love “gives us the power to resist fear’s temptations,” Obama said. “…He gives us the courage reach out to others across that divide, rather than push people away.”

With less than a year left in his presidency, Obama’s remarks amounted to a brief and heartfelt prayer for the country he would soon no longer be leading. “Like every president, like every person I have known fear,” said Obama. After the shootings at Newtown, Conn. elementary school, that fear and grief drove him to his knees in prayer, he said.

Even as he seemed to criticize the harsh political rhetoric and anti-immigrant sentiment that have dominated the recent election cycle, Obama also sought to praise his country. He said he saw God’s hand in acts of decency and compassion that he’s seen both here and abroad during the course of his presidency.

“He gives us the fortitude to sacrifice ourselves to a larger cause,” Obama said. “Less of me more of God.”