RIO DE JANEIRO, Brazil -- Pope Francis' historic trip to his home continent ended Sunday after a marathon weeklong visit to Brazil that drew millions of people onto 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 on Sunday, Francis urged a crowd estimated at 3 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 Sunday, 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 Francis called the "sinful complicity" of lay Catholics who hold the clergy in such high esteem.
Despite a series of organizational snafus, including a subway breakdown Wednesday that stranded hundreds of thousands of people for hours, Francis' 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 has seen the 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," Temer said on the tarmac of 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 4-kilometre-long (2.5 mile) Copacabana beach overflowed Sunday with flag-waving faithful, some of them taking an early morning dip in the Atlantic and others tossing T-shirts, flags and soccer jerseys 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' car, caught up in the enthusiasm of the crowd.
The numbers clearly overwhelmed the area's services: The stench of garbage 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 cookie wrappers as trash collectors in orange uniforms tried to restore order.
"You'd think they could at least put their garbage in all the bins," said Jose da Silva, a 75-year-old retired farm worker who supplements his meagre income by collecting empty cans for recycling. "I'm also pretty surprised that people who call themselves Christians would throw away all this food."
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 Francis lived for a time before becoming pope. "It was a tiring day, but it was a great experience."
The Vatican said more than 3 million people were on hand for the Mass, based on information from World Youth Day organizers and local authorities who estimated two-thirds were from outside Rio. That was far higher than the 1 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 5 million people taking part. Third place among papal Masses now goes to Rome's World Youth Day in the 2000 Jubilee year, when 2 million people participated. A similar number attended 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, Francis announced Sunday that the next World Youth Day would be held in Krakow in 2016.
The presidents of Brazil, Francis' native Argentina, Bolivia and Suriname were on hand for the Mass, as were the vice-presidents of Uruguay and Panama. Receiving a special honour was a couple Francis met on Saturday after Mass at Rio's cathedral; they had brought him their anencephalic baby daughter to be blessed. Francis invited them to participate in the offertory procession Sunday, at which the father wore a T-shirt that read "Stop abortion."
Later, the pope thanked some of the 60,000 volunteers who organized the youth festival before flying to Rome. He called on the thousands of young people packed into a vast hall to "be revolutionaries" and "swim against the tide."
Francis spent much of the week emphasizing that core message: of the need for Catholics, lay and religious, to shake up the status quo, get out of their stuffy sacristies and reach the faithful on the margins of society or risk losing them to rival churches.
According to census data, the number of Catholics in Brazil dipped from 125 million in 2000 to 123 million in 2010, with the church's share of the total population dropping from 74 per cent to 65 per cent. During the same time period, the number of evangelical Protestants and Pentecostals jumped from 26 million to 42 million, increasing from 15 per cent to 22 per cent of the population.
While speaking to the young volunteers, Francis urged those thinking of dedicating their lives to the church to follow the urge, recalling the day he felt the calling.
"I will never forget that day, 21 September -- I was 17 years old -- when, after stopping in the Church of San Jose de Floresto to go to confession, I first heard God calling me," he said. "Do not be afraid of what God asks of you! It is worth saying 'yes' to God. In him we find joy."