At the National Prayer Breakfast Thursday, President Obama condemned recent acts of violence by people he said "seek to hijack religion for their own murderous ends."

"We've seen professions of faith used both as an instrument of great good and but also twisted and misused in the name of evil," the president said. "We also see faith being twisted and distorted, used as a wedge, or worse, sometimes used as a weapon."

He cited a Taliban massacre at a school in northwestern Pakistan, the terror attacks in Paris and the rise of the Islamic State of Iraq and Syria (ISIS) as examples of instances where people "profess to stand up for Islam but in fact are betraying it." He also singled out ISIS, which earlier this week released a video purporting to kill a captured Jordanian pilot by burning him alive in a cage, as a "brutal vicious death cult that in the name of religion carries out unspeakable acts of barbarism."

Get Breaking News Delivered to Your Inbox

"No God condones terror. No grievance justifies the taking of innocent lives or the oppression of those who are weaker or fewer in number. And so as people of faith, we are summoned to push back against those who try to distort our religion - any religion for their own nihilistic ends," he said.

But Mr. Obama also cautioned against those who might say the violence in the name of religion that has cropped up recently is a lone phenomenon.

"Humanity has been grappling with these questions throughout human history, and lest we get on our high horse and think this is unique to some other place remember that during the Crusades and the Inquisition people committed terrible deeds in the name of Christ," he said. "In our home country, slavery and Jim Crow all too often was justified in the name of Christ."

The annual meeting, in its 63rd year, brings together politicians, faith leaders and other important figures for a nonpartisan breakfast meeting to speak about faith. In the audience this year was the Dalai Lama, the spiritual leader of Tibetan Buddhists, although he did not speak. Mr. Obama called the Dalai Lama a "good friend" whom he said "is a powerful example of what it means to practice compassion and who inspires us to speak up for the freedom and dignity of all human beings."

The Dalai Lama's presence at the breakfast angered the Chinese government, which warned the president not to meet with him directly. They oppose his drive for Tibetan independence.

The president also offered a guiding set of principles for the faithful, citing "basic humility" as a top priority.

"I believe that the starting place of faith is some doubt; not being so full of yourself and so confident that you are right and that God speaks only to us, and doesn't speak to others, that God only cares about us and doesn't care about others, that somehow we alone are in possession of the truth," Mr. Obama said.

He also praised America's Founding Fathers for three principles they championed in the creation of the United States: freedom of religion, freedom of speech, and separation of church and state.

Part of having humility in faith, he said, is learning how to uphold each of those rights and principles in modern, diverse societies.

"The concern for the protection of these rights calls for each of us to exercise civility and restraint and judgment and if in fact we defend the legal right of a person to insult another person's religion, we are equally obligated to use our free speech to condemn such insults and stand shoulder to shoulder with religious communities, particularly religious minorities who are targets of such attacks," the president said.

He also discussed a letter he received from Saeed Abedini, a Christian American pastor who is being imprisoned in Iran for allegedly fostering a network of Christian churches there. In the letter, which Abedini wrote from prison, Mr. Obama said he described his captivity and expressed gratitude for the president's recent visit to his family during a visit to Boise, Idaho.

"He closed his letter by describing himself as prisoner for Christ who is proud to be part of this great nation, the United States of America, that cares for religious freedom around the world," Mr. Obama said.