This is an archived article that was published on in 2016, and information in the article may be outdated. It is provided only for personal research purposes and may not be reprinted.

Krakow, Poland • Pope Francis encouraged hundreds of thousands of young people at a global gathering Sunday to "believe in a new humanity" that is stronger than evil and refuses to see borders as barriers.

His appeal came at the end of World Youth Day, a weeklong event held in southern Poland this year that draws young Catholics from around the world every two to three years to a different country for a spiritual pep rally.

The youth gathering was Francis' main focus during his pilgrimage to Poland, but over five days in this deeply Catholic nation he also prayed in silence at the former Nazi Auschwitz death camp and implored God to keep away a devastating wave of terrorism now hitting the world. He also met with Poland's political and church leaders.

For the second straight day, a huge crowd filled a vast field Sunday in the gentle countryside outside the city of Krakow to see Francis, who was visiting central and eastern Europe for the first time.

Security was very tight throughout the pope's five-day visit, but he encountered huge crowds day after day without incident and arrived back in Rome on Sunday evening.

Many of the faithful had camped out overnight after an evening of entertainment and prayer with the pope in the same field Saturday night that drew 1.6 million people, according World Youth Day organizers.

Sunday's faithful numbered at least in the hundreds of thousands. The Rev. Federico Lombardi, a Vatican spokesman, referred to an estimate by Polish authorities of 1.5 million at Sunday's closing Mass.

The pope used his several encounters with the young pilgrims — from mega-gatherings to a private lunch with only a dozen people 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.

Later Sunday, on his way to the airport, Francis met with hundreds of young volunteers to thank them for their work. He had a speech prepared but looking at the pages in his hand with annoyance he said, "five pages?" and then began speaking freely in his native Spanish.

"Do you want to be hope of the future?" he asked, getting an enthusiastic "Yes!"

Earlier in his pilgrimage, Francis had expressed dismay that many people and places aren't welcoming enough to refugees or those fleeing poverty in their homelands.

After over 1 million people arrived on Europe's southern shores last year, some nations on the continent, notably in central and eastern Europe, hastily built fences to keep the refugees out. Poland has been among the EU countries that have refused to take in many Muslim refugees, saying it has already welcomed hundreds of thousands of Ukrainian immigrants.

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.

The World Youth Day events took place amid very high security following a string of extremist attacks in Western Europe, with an elderly French priest being slain in his Normandy church Tuesday, the day before Francis arrived in Poland.

Since the Paris extremist attacks in early 2015, concerns have heightened that the Vatican, and the pope in particular, could be targeted because of his role as the most influential Christian leader. When the pope travels, a corps of Vatican bodyguards travels with him, running alongside his popemobile or scrutinizing crowds along the route.

On Saturday, at a Mass attended mainly by Polish priests, nuns and seminarians, sniffer dogs patrolled the perimeter, searching for explosives. Police opened every bag of those entering and waved metal-detecting wands carefully over each person.

At Sunday's Mass, several Polish police vans followed the pope's open-sided popemobile as he rode through the wide flat meadow in the middle of hundreds of thousands of pilgrims. Motorcycle police rode close to metal barriers keeping the crowd away.

Francis also spoke of terrorism in some of his remarks and made an unscheduled stop Saturday at a Franciscan church in Krakow, where he implored God in prayer to "keep away the devastating wave of terrorism" in much of the world and to "touch the hearts of the terrorists, so that they recognize the evil of their actions and return to the path of peace and of good."

At the end of Sunday's Mass, Francis announced that the next World Youth Day will take place in Panama in 2019. Later, he told rally volunteers he did not know if he would be at that one.