Pope Francis celebrated Mass on Tuesday for Sweden's tiny Catholic community, made up of many refugees and migrants, praising as "blessed" those in this overwhelmingly non-religious nation who take in asylum seekers.
The main purpose of the pope's two-day trip was to take part in a joint commemoration with Lutherans of the 500th anniversary of the start of the Reformation.
After the historic inter-religious ceremony on Monday, Francis turned his attention to largely secular Sweden's record of accepting tens of thousands of asylum seekers last year, in contrast to many other European nations.
In a football stadium packed with some 15,000 spectators, Francis weaved his homily around Jesus' "Sermon on the Mount," which lists the Beatitudes, but added a few modern twists.
"Blessed are those who look into the eyes of the abandoned and marginalised and show them their closeness," the Argentine-born pontiff said. "Blessed are those who renounce their own comfort in order to help others."
Francis's statement held special symbolism in Malmo, which has become a gateway for thousands of immigrants who have fled from Middle East wars over the last few years.
The Mass was also a shot in the arm to Sweden's small Catholic community, which numbers only about 150,000 out of a population of about 10 million. That total is less than the attendance for some papal ceremonies in Rome.
"A decade or so ago, people were even uneasy about wearing crosses, having to explain to Swedes who did not understand," Josephine Kabogoza-Muksoke, a Ugandan-born Catholic, said as the pope drove by in a golf cart around Malmo stadium.
"That isn't so now. Catholics have more confidence and there are more of us - thanks to immigration."
ACCEPTANCE AND CRITICISM OF IMMIGRATION
Thousands of Swedes, many immigrants from Latin America, the Middle East and Asia, had lined up outside the stadium in cold autumn rain.
Sweden took in 163,000 asylum seekers last year, more than any other European Union state relative to population. Its reputation for tolerance and stability have made it a haven for refugees for decades.
Polls say Sweden is one of the world's most irreligious nations. In a WIN-Gallup survey last year, around eight in 10 Swedes said they were either "not religious" or "convinced atheists." Surveys show Swedes trust institutions like the tax agency more than the Lutheran Church.
Still, they have been more accepting of migrants and refugees than Catholic countries such as Poland and Hungary.
The mood started to change last year, with many Swedes unnerved by reports of rising foreigner crime including gang activity in immigrant-heavy cities.
Even many liberal Swedes are having second thoughts, put off by reports of crime including sexual assaults by asylum seekers and financial strains on the nation's prized cradle-to-grave welfare system.
With about 17 percent of Swedes now foreign-born, multi-culturalism has challenged Sweden's comfortable secular identity.
Concerns about immigration have boosted support for the rightist Sweden Democrats, now backed by around 17 percent of voters in polls, up from the 13 percent they received in a general election in 2014.
In his homily, the pope also appeared to praise Sweden for its strong defence of the environment and efforts to fight the effects of climate change, saying; "Blessed are those who protect and care for our common home.