President Obama on Thursday scolded China, Iran, North Korea and other countries known for repressing religious minorities and declared that promoting freedom of faith around the world was a central goal of American foreign policy.

Speaking at the annual National Prayer Breakfast, Mr. Obama singled out the government in Beijing and urged it to do more to allow Christians and others to worship. He also called on North Korea to release a Christian missionary held for the last 15 months and insisted that Iran release a Christian pastor held for more than 18 months.

“History shows that nations that uphold the rights of their people, including the freedom of religion, are ultimately more just and more peaceful and more successful,” Mr. Obama told a hotel ballroom audience of 3,500 people. “Nations that do not uphold these rights sow the bitter seeds of instability and violence and extremism. So freedom of religion matters to our national security.”