VATICAN CITY (Reuters) - Pope Francis on Saturday said an “epidemic of animosity” against people of other races or religions was hurting the weakest in society, striking a note of caution against the rise of populist nationalism.

Little more than a week after Donald Trump was elected the next U.S. president, buoying anti-immigrant parties in Europe and elsewhere, the pope noted “how quickly those among us with the status of a stranger, an immigrant or a refugee become a threat, take on the status of an enemy...

“An enemy because they come from a distant country or have different customs. An enemy because of the color of their skin, their language or their social class. An enemy because they think differently or even have a different faith,” he said at a ceremony to induct new cardinals.

While not naming any country, Francis appeared to refer to anti-immigrant and anti-Muslim attitudes that surfaced during the U.S. campaign and since the election.

The U.S. Justice Department said on Friday it was investigating reports of intimidation and harassment in schools, churches and elsewhere since the election.

One of the new cardinals, Archbishop Blase Cupich of Chicago, told Reuters the pope was “very much aware of the fact that if that (animosity) is not checked, it is very contagious and it can spread quickly, it can be like a wildfire”.

In his homily, the pope said the Church itself was not immune to “a virus of polarization and animosity”, an apparent reference to a public challenge by four conservative cardinals, who accused him of sowing confusion on moral issues..

In the “consistory” ceremony in St. Peter’s Basilica, Francis appointed 17 new cardinals, 13 of them under 80 and thus still eligible to succeed him.

Afterwards, the pope and the new cardinals boarded two buses and visited former pope Benedict, who has been living in a house in the Vatican gardens since resigning in 2013.

Naming new cardinals allows a pontiff to put his stamp on the future of the 1.2-billion-member Church. The appointees come from 15 countries and many are progressives like the pope. Three come from the United States.

The new cardinal-electors under 80, eligible to take part in a papal conclave, come from Italy, the Central African Republic, Spain, the United States, Brazil, Bangladesh, Venezuela, Belgium, Mauritius, Mexico and Papua New Guinea.

Those over 80 come from Italy, Malaysia, Lesotho and Albania.

Francis has now named 44 cardinal-electors, slightly more than a third of the total of 120 allowed by Church law.

It was Francis’ third “consistory” since his election in 2013 as the first non-European pontiff in 1,300 years, and he has used each occasion to show support for the Church in far-flung places or where Catholics are suffering.