KRAKOW, Poland - Pope Francis on Sunday encouraged the throngs of young people gathered in southern Poland to "believe in a new humanity," which is stronger than evil and refuses to use borders as barriers.
His appeal came at the end of World Youth Day, a weeklong event which draws young Catholics to a different city every three years in a polyglot spiritual pep rally.
The event was Francis main focus during his pilgrimage to Poland, which also included meditation at the Auschwitz death camp and an imploration to God to keep away a devastating wave of terrorism.
Polish police say no major security incidents have been reported during Pope Francis' five-day visit to the country, which has been protected by top-level security measures including sniffer dogs and anti-terrorism forces with machine guns.
As the pope's visit was drawing to an end Sunday, police spokesman Mariusz Ciarka said unattended bags were biggest problem for security services as each such bag had to be checked.
The slaying of an 85-year-old French priest by two extremists in Normandy on Tuesday had compounded security fears surrounding Francis' trip, which were already high due to a string of violent attacks in France and Germany.
Officials said they deployed tens of thousands of security officials to cover the event.
Ciarka said that uniformed and plain-clothes security forces were deployed on boats on the Vistula River, in helicopters that flew around the crowds and on land.
For a second straight day, a huge crowd filled a green field in the gentle countryside outside of Krakow for Francis, whose five-day trip introduced the Argentine to Eastern Europe.
Some of the faithful had camped out overnight after an evening of entertainment and prayer with the pope there that drew 1.6 million people, according World Youth Day organizers.
World Youth Day spokesperson Anna Chmura told Agence France Presse there were "between 2.5 and 3.0 million people," at the final celebration. Polish police declined to give an estimate.
Sunday's faithful numbered at least in the hundreds of thousands, similar to the number of attendants seen at the pope's other public appearances in the overwhelmingly Catholic country in the past days.
The pope used his several encounters with the young pilgrims - from mega-gatherings to a private lunch with only a dozen of them from five continents - to encourage a new generation to work for peace, reconciliation and justice.
God, said Francis in his final homily of the pilgrimage, "demands of us real courage, the courage to be more powerful than evil, by loving everyone, even our enemies."
"People may judge you to be dreamers, because you believe in a new humanity, one that rejects hatred between peoples, one that refuses to see borders as barriers and can cherish its own traditions without being self-centered or small-minded," Francis told his flock before him, many of them in their late teens, 20s or 30s.
Earlier in his pilgrimage, Francis had expressed dismay that many people and places aren't welcoming to refugees or those fleeing poverty in their homelands.
As hundreds of thousands of migrants arrive in smugglers' boats on Europe's southern chores, some nations on the continent, notably in central and eastern Europe, have thrown up fences to keep the refugees out. Poland has been among the countries which have refused to take in many refugees, saying it already hosts many Ukrainian migrants.
Attending Francis' closing Mass on Sunday were some of Poland's top leaders, including President Andrzej Duda and Jaroslaw Kaczynski, head of the conservative ruling Law and Justice party. Kaczynski is widely regarded as the most powerful figure in Poland's politics and toes a generally pro-Catholic but anti-migrant line.
On his way to the site, Francis made a stop to bless two buildings run by the Catholic charity Caritas, one built as a day center for the elderly and the other to be a storehouse for food for the needy called "The Bread of Mercy."
As he left, Francis nibbled on some dark bread from a big, round loaf offered by women in traditional Polish costumes. He nodded in approval as he chewed away.
Later, Francis announced that the next World Youth Day will take place in Panama in 2019.