Countries that are unable to assimilate migrants should stop accepting more until they are able to integrate them, Pope Francis told reporters on the papal plane Monday.

The pope put forward Sweden as an example of a country that had accepted many migrants in the past but realized recently that the migrants coming in were becoming ghettoized rather than integrating in Swedish society, and so put a moratorium on accepting more.

“A ruler must use prudence, because prudence is the virtue of those who govern,” Francis told reporters during a press conference returning from Panama.

“I am reminded of the example of Sweden, which took in many migrants escaping from dictatorships in Latin America in the 1970s, but all of them were integrated,” he said.

“But last year the Swedes said stop for a while because we are unable to finish the integration process. And this is the prudence of the ruler,” Francis said.

While praising the “generosity” of nations such as Italy, Greece, and Lebanon in receiving migrants and refugees, the pope said that more “realism” was needed.

“The way to solve the problem of migration is to help the countries where migrants come from,” he said. “They come because of hunger or war. Invest where there is hunger. Europe is capable of doing this, and this is a way to help those countries grow.”

Despite the pope’s well-known vocal advocacy for immigration, this is not the first time he has suggested that there are important limits.

Returning from Sweden itself in November 2016, Francis suggested that playing host to unassimilated migrants can lead to a dangerous “ghettoization,” which is bad for the migrants themselves as well as the nation.

On that occasion as well, the pope counseled prudence in determining how many migrants should be received by a given country.

The pope’s words followed on a meeting with an unnamed government official who informed Francis that Sweden was 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.”

“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.

Rising numbers of mostly Islamic immigrants in Sweden had led to 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 foreign-born.

Follow Thomas D. Williams on Twitter Follow @tdwilliamsrome