ROME—As the European Union and the United Kingdom work out the terms of their divorce after the Brexit vote, Pope Francis on Saturday warned that Europe today seems to be building “walls of political and economic selfishness, without respect for the life and dignity of every person.”

Without mentioning Brexit, the pontiff said that a spirit of unity in Europe today is “more than ever necessary.”

Francis was addressing a gathering of the “Together for Europe” initiative, which brings together over 300 Christian movements and communities of different denominations. From June 30 to July 1, the group gathered in Munich, Germany, under the motto “Encounter-Reconciliation-Future.”

In a video message released by the Vatican on Saturday, Francis decried the “visible walls” that are being built around the continent. He didn’t mention any countries by name, but in recent months Austria, Hungary, Croatia, Macedonia and Slovenia all have erected new barriers in an attempt to stop migrants from entering their territories.

The pope also lamented the “other invisible walls being strengthened which tend to divide our continent.”

These walls, Francis said, are being built in people’s hearts, and are made of “fear and aggression, a failure to understand people of different backgrounds or faith.”

While Francis never mentioned the June 23 Brexit referendum, his words could be taken, in part, as a reaction to the result. Many of the 51 percent of the British electorate who voted in favor of the United Kingdom leaving the European bloc did so out of resentment over migrants, who they saw a threat to the British economy.

Speaking about the continent’s future, at a time when countries such as Germany and France fear a domino effect after the UK’s decision, Francis said that for Europe to be a “family of peoples” it needs to put the human person “back at the center.”

“It should be an open and welcoming continent, and continue to establish ways of working together that are not only economic but also social and cultural,” he said.

Towards the end of the message, Francis asks: “Together for Europe? Today this is more than ever necessary.”

Francis also challenged today’s Europe to decide if its heritage, “highly permeated by Christianity,” belongs in a museum or if it can “still inspire culture and offer its treasures to humankind.”

“It is time to get together, to face the problems of our day with a true European spirit,” Francis said.

In a Europe made up of many nations, he said, Christians of different denominations gathering to talk about unity gives witness to the fact that “we are children of one Father, and brothers and sisters to one another.”

This is not the first time the Latin American pope has waded into debates about Europe. Last May, he broke his own rule about not accepting awards to receive the Charlemagne Prize, given to individuals or institutions for their efforts towards European unity.

On that occasion, he said that he was convinced that “resignation and weariness do not belong to the soul of Europe, and that even our problems can become powerful forces for unity.”