Pope Francis has wrapped up his visit to Poland with a huge outdoor mass in the city of Krakow.

Hundreds of thousands of young people had camped out for the night for the event.

They waved national flags and cheered as Francis arrived to celebrate mass in a large field on the outskirts of Krakow, after presiding at the Catholic Church's World Youth Day festivities.

Pope Francis told young people to look beyond the instant gratification afforded by technology, and instead to try to change the world.

The pontiff announced that the next World Youth Day will be held in Panama in 2019.

It will be the first time a pope visits the Central American country since Pope John Paul II's trip there in 1983.

Francis was speaking on the final day of his official five-day visit to Poland which included a trip to the concentration camp, Auschwitz.

Yesterday the pontiff made an unscheduled stop at the church of St Francis of Assisi in Krakow to recite a prayer for peace.

He condemned the "devastating wave of terrorism" and war that has hit the world and urged a huge crowd of young people not to be indifferent to the suffering of others.