In a hard-hitting speech to government leaders including Prime Minister Viktor Orban, who has had a series of run-ins with the European Union, Francis also urged a rejection of "self-referential forms of populism" and strictly nationalist interests.
Francis called for a return to the "European soul" envisioned by those who laid the groundwork for modern Europe after World War II, saying nations had to "look beyond national boundaries."
Speaking on the day that Kyiv vowed an "iron fist" response after Russia hit Ukraine with the first large-scale air strikes in nearly two months, Francis made another appeal for an end to the war there, calling for "creative efforts for peace" to drown out the "soloists of war."
The three-day visit is the 86-year-old pope's first trip since he was admitted to hospital for bronchitis in March.
Looking cheerful, Francis, who has a knee ailment, used a cane to walk by welcoming dignitaries and children in national dress at the airport. In recent arrivals, he used a wheelchair.
Asked by reporters about his health on the flight from Rome, the pope joked, saying "I'm still alive" and "stubborn weeds never die."
Francis is keeping a promise of an official visit to Hungary after a stop of only seven hours to close a Church congress in Budapest in 2021 on his way to Slovakia left many feeling slighted.
Prime Minister Orban, 59, and the pope have differing views on handling migration from the Middle East and Africa to Europe, with Francis believing migrants fleeing poverty should be welcomed.
Orban, whose government built a steel fence on the border with Serbia to keep out migrants, has refused to let Hungary be transformed into an "immigrant country" like he says others in Europe have become.
But Francis appeared to give comfort to Orban's rejection of the imposition of what he says are liberal values by outsiders. Francis denounced any form of "ideological colonization" on issues such as "so-called gender theory" or "the right to abortion."