Pope Francis has said that Hungary could preserve its Christian roots while opening up to the needy, an apparent response to nationalist Prime Minister Viktor Orban's stand that Muslim immigration could destroy its heritage.
Francis arrived in Hungary early this morning for an unusually short stay that underlines differences with the anti-immigrant Orban, his political opposite.
Closing a Church congress with a Mass for tens of thousands of people in central Budapest, Francis used the imagery of a cross to show that something as deeply rooted as religious belief did not exclude a welcoming attitude.
"The cross, planted in the ground, not only invites us to be well-rooted, it also raises and extends its arms towards everyone," he said in his remarks after the Mass.
"The cross urges us to keep our roots firm, but without defensiveness; to draw from the wellsprings, opening ourselves to the thirst of the men and women of our time," he said.
"My wish is that you be like that."
Francis has often denounced what he sees as a resurgence of nationalist and populist movements, called for European unity, and criticised countries that try to solve the migration crisis with unilateral or isolationist actions.
Mr Orban, by contrast, told the Bled Strategic Forum in Slovenia last week the only solution to migration was for the European Union to "give all rights back to the nation state".
The pope has called for migrants to be welcomed and integrated to tackle what he has called Europe's "demographic winter". Mr Orban said in Slovenia that today's migrants "are all Muslims" and that only "the traditional Christian family policy can help us out of that demographic crisis".
Francis, who was spending only seven hours in the capital Budapest, met Mr Orban and President Janos Ader at the start of his visit.
The Vatican said the meeting, which was also attended by the Vatican's top two diplomats and a Hungarian cardinal, lasted about 40 minutes and was cordial.
"I asked Pope Francis not to let Christian Hungary perish," Mr Orban said on Facebook.
Hungarian news agency MTI said Mr Orban gave Francis a facsimile of a letter that 13th century King Bela IV sent to Pope Innocent IV asking for help in fighting the Tartars.
Later, Francis moves on to Slovakia, where he will stay much longer, visiting four cities before returning to Rome on Wednesday.
The brevity of his Budapest stay has prompted diplomats and Catholic media to suggest the pope is giving priority to Slovakia, in effect snubbing Hungary.
The Vatican has called the Budapest visit a "spiritual pilgrimage". Mr Orban's office has said comparisons with the Slovakia leg would be "misleading".
The trip is the pope's first since undergoing major surgery in July. Francis told reporters on the plane taking him to Budapest that he was "feeling fine".