Pope Francis's historic trip to his home continent ended yesterday after a marathon week-long visit to Brazil that drew millions of people on to the sands of Rio de Janeiro's iconic Copacabana beach and appeared to reinvigorate the clergy and faithful alike in the world's largest Catholic country.

Dignitaries including Brazilian vice president Michel Temer turned out at Rio's Antonio Carlos Jobim international airport to bid farewell to the Argentine-born pontiff after a visit marked by big moments. They included a visit to a vast church dedicated to Brazil's patron saint, a rainy walk through one of Rio's dangerous slums and a papal Mass that was one of the biggest in recent history.

Speaking from a white stage on the sands of Copacabana, Pope Francis urged a crowd estimated at three million people to go out and spread their faith "to the fringes of society, even to those who seem farthest away, most indifferent".

"The church needs you, your enthusiasm, your creativity and the joy that is so characteristic of you!" he said to applause in his final homily of World Youth Day festivities.

Later, he issued a more pointed message to the region's bishops, telling them to better look out for their flocks and put an end to the "clerical" culture that places priests on pedestals - often with what Pope Francis called the "sinful complicity" of lay Catholics who hold the clergy in such high esteem.

Despite a series of organisational issues, including a subway breakdown on Wednesday that stranded hundreds of thousands of people for hours, Pope Francis's visit was widely hailed as a success by the Vatican, pilgrims and everyday Brazilians alike. His nonstop agenda was followed live on television for all seven days, his good nature and modesty charming a country that has seen a phenomenal rise of Protestant and evangelical Pentecostal churches in the past decades.

"You came to see the young people but you ended up enchanting all Brazilians," Mr Temer said at Rio's main airport minutes before the Pope's takeoff. He added that the country's door would be permanently open to the pontiff and called on him to "just enter without knocking, because there will always be a place for Your Holiness in Brazilians' hearts".

Nearly the entire four-kilometre-long Copacabana beach overflowed with flag-waving faithful, some of them taking an early morning dip in the Atlantic and others tossing T-shirts, flags and football shirts into the pontiff's open-sided car as he drove by.

Even the normally stern-faced Vatican bodyguards let smiles slip as they jogged alongside Francis's car, caught up in the enthusiasm of the crowd.

The numbers clearly overwhelmed the area's services: The stench of rubbish and human waste hung in Rio's humid air, and the beach and adjoining chic Atlantic Avenue looked like an improvised refugee camp plunked down in the middle of one of the world's most beautiful cities. Copacabana's famous mosaic sidewalks were strewn with trampled cardboard, plastic bags, empty water bottles and wrappers as waste collectors in orange uniforms tried to restore order.

Many of the youngsters on hand for the Mass spent the night on the beach, joining an all-night slumber party to end the Catholic youth fest, with pilgrims wrapped in flags and sleeping bags to ward off the cold.

"We were dying of cold but it was worth it," said Lucrecia Grillera, an 18-year-old from Cordoba, Argentina, where Pope Francis lived for a time before becoming Pope. "It was a tiring day, but it was a great experience."

The Vatican said more than three million people were on hand for the Mass, based on information from World Youth Day organisers and local authorities who estimated two-thirds were from outside Rio. That was far higher than the one million at the last World Youth Day in Madrid in 2011 or the 850,000 at Toronto's 2002 concluding Mass.

Only Pope John Paul II's Mass during his 1995 visit to Manila, the capital of the Philippines, topped Rio's numbers, with an estimated five million people taking part. Third place among papal Masses now goes to Rome's World Youth Day in the 2000 Jubilee year, when two million people participated. A similar number attended Pope John Paul's final Mass in Krakow, his Polish hometown, in 1979, during his first visit to his homeland as pope.

As if recalling that historic Mass, Pope Francis announced that the next World Youth Day would be held in Krakow in 2016.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.