VATICAN CITY — Pope Francis on Saturday criticized what he called a polarizing surge in much of the world to exclude people of different nationalities, races or beliefs as enemies as he led a ceremony welcoming 17 new cardinals from six continents.

He called for the “conversion of our pitiful hearts that tend to judge, divide, oppose and condemn” and cautioned against those who “raise walls, build barriers and label people.”

“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,” the pope said. “An enemy because they come from a distant country or have different customs.”

The ceremony, held in St. Peter’s Basilica, formally inducted the priests as cardinals. One of the new “princes of the church,” as the cardinals are sometimes called, an 87-year-old bishop from Lesotho, in southern Africa, was too frail to attend the ceremony; his red hat will be delivered to him, the pope announced in Latin.