SOFIA, Bulgaria — Making his first visit to Bulgaria, Pope Francis on Sunday pointedly appealed for care for migrants in one of the corners of Europe that has been most unwelcoming to them — a stance that puts him at odds with both the country’s government and its dominant church.

Since the migrant crisis of 2015, one of the pope’s most emphatic and consistent messages has been the need to welcome refugees, who he believes have been exploited by fear-mongering European nationalists.

But rarely has he delivered it in a nation that has so few Roman Catholics — they make up less than 1 percent of the seven million people in a country that is mostly Bulgarian Orthodox — or such powerful opposition to his view (though the Vatican itself is surrounded by widespread hostility toward immigrants that enabled the right to take power in Italy).

After a brief meeting Sunday morning with President Rumen Radev in the capital, Sofia, Francis noted that Bulgaria was “familiar with the drama of emigration.” The country is losing its youth and educated classes to opportunities abroad and has, according to the United Nations, the fastest-shrinking population in the world.