In an unusually nuanced discourse, Pope Francis has seemed to walk back earlier statements encouraging European nations to open their doors to migrants and refugees, suggesting that harboring unassimilated migrants can lead to a dangerous “ghettoization.”

During the short papal press conference on the return flight from Sweden to Rome Tuesday, the Pope expressed his belief that people’s hearts should be open to migrants and refugees, but that political authorities need to exercise prudence so as not to allow more migrants into the country than can be reasonably assimilated.

The Pope’s words followed on a meeting with an unnamed government official who informed Francis that in these times Sweden is experiencing difficulties integrating the large numbers of migrants who are arriving into the country. He spoke to me of troubles they are having, Francis said, “because so many of them are coming that there isn’t time to settle them, find school, lodging, work, learn the language.”

While praising Sweden’s history of welcoming, including many from South America, the Pope said that welcoming isn’t enough—integration is essential.

“What is the danger when a refugee or migrant is not integrated?” Francis asked. “He is ghettoized, that is, he enters a ghetto. And a culture that does not develop in relation with another culture, that is dangerous,” he said.

The Pope was likely referring to a problem in Sweden due to rising numbers of mostly Islamic immigrants, which has resulted in the development of Muslim-controlled “no-go zones” where law enforcement fears to enter.

Sweden is often referred to as the “world’s capital of asylum seekers” and some 17 percent of Swedes are now foreign-born.

In certain parts of Sweden, police say that up to 25 percent of their time and resources are spent on incidents involving migrants, and last month the Swedish government allocated a further two billion Swedish Krona for policing to 2020.

In his response, the Pope also insisted on the importance of distinguishing between migrants and refugees, suggesting that they represent different problems. “Migrants should be treated according to certain rules, because migration is a right, but one which is highly regulated,” he said. “On the other hand, to be a refugee means coming from a terrible situation of war, anguish, hunger and the status of a refugee requires more care, more work.”

Pope Francis even made allowances for European politicians who have completely closed their borders to immigrants, saying that politicians have a right to exercise prudence in such decisions.

“So what do I think of those who close their borders?” Francis asked. “I think that in theory no one should close their heart to a refugee, but those who govern must also exercise prudence. They should be very open to receiving them, but they should also calculate how they will be able to settle them, because a refugee must not only be welcomed, but also integrated.”

“And if a country is only able to integrate 20, let’s say, then it should only accept that many. If another is able to do more, let it do more,” he said.

“But always with an open heart,” he continued. “It isn’t human to close one’s doors, one’s heart, and in the long run you pay for it. Here, you pay for it politically, just as you can pay politically for imprudence in your calculations, by taking in more than you can possibly assimilate.”

Sweden has been particularly hard hit by Europe’s migrant crisis, in part because of its sweeping social welfare benefits that make it an attractive destination for those looking to rise out of poverty, and in point of fact, it has not been able to assimilate them.

This summer, Breitbart News reported that of the 163,000 migrants who arrived in Sweden in 2015, fewer than 500 have found jobs, meaning that the vast majority depend on taxpayer-funded welfare assistance for their sustenance. In the mid- to long-term, this is unsustainable.

Pope Francis said that if Sweden stops taking in so many migrants it will not be “out of selfishness,” but out of prudence. “Today many look to Sweden because they know how welcoming it is, but there just isn’t time to settle them all,” he said.

Follow Thomas D. Williams on Twitter Follow @tdwilliamsrome