Pope Francis warned against what he called a "virus of polarisation" and hostility in the world targeting people of different nationalities, races or beliefs, as he led a ceremony giving the Catholic Church 17 new cardinals from six continents.
The consistory ceremony in St Peter's Basilica formally inducted the churchmen into the cardinals' ranks.
Francis used his homily to also caution the new "princes of the church," as cardinals are sometimes called, to guard against animosity creeping into the church as well, saying "we are not immune from this".
The Pope spoke of "our pitiful hearts that tend to judge, divide, oppose and condemn" and cautioned sombrely against those who "raise walls, build barriers and label people."
Earlier this year, when asked about the plan by Donald Trump, then a Republican US presidential candidate and now president-elect, to build a wall to keep Mexicans from entering the US, the Pope replied that anyone advocating building walls isn't a Christian.
Francis, in a message a few days earlier to US bishops, had urged them to help heal a society facing growing polarisation.
On Saturday, after receiving his red hat, Mexican Cardinal Carlos Aguiar Retes, archbishop of Tlalnepantla, expressed concern about Trump's plans, including deporting large numbers of undocumented migrants soon after assuming the presidency.
"You can't divide a family. You can't divide a community. You can't divide the world," the prelate said in reply to a question by The Associated Press about Trump. The Mexican churchman added: "One thing is the election campaign. Another thing is reality."
In Saturday's homily, Francis commented on how "we see, for example, how quickly those among us with the status of the 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 colour of their skin, their language, or social class."
He added: "The virus of polarisation and animosity permeates our way of thinking, feeling and acting."
Francis also lamented the tendency to "demonise" one's opponents, "so as to have a 'sacred' justification for dismissing them".
Cardinals serve as papal advisers and someday elect popes' successors. Popes look to cardinals who share their approach to the church's mission in the world.