Hundreds of thousands of Catholics greeted Pope Francis on Rio de Janeiro's Copacabana beach on Thursday in another rousing reception after the champion of the poor visited a notorious slum.
The crowd waved flags, took pictures and shouted his name as a Popemobile with open sides and a glass top took him along the rain-drenched coastline.
The pope was taken to a giant stage on the beach where he was treated to samba songs and dance before he was due to address young Catholics who poured onto the beach for World Youth Day.
The scene was a stark contrast to his visit just hours earlier to one of the city's notoriously dangerous favelas, or slums, where he waded into a national debate over poverty and corruption that erupted in massive protests last month.
"Dear young friends, you have a particular sensitivity towards injustice, but you are often disappointed by facts that speak of corruption on the part of people who put their own interests before the common good," he said.
"To you and to all, I repeat: never yield to discouragement, do not lose trust, do not allow your hope to be extinguished," he told thousands gathered under pelting rain on a soccer field in the Varginha slum.
"Situations can change, people can change."
Brazil was rocked by the largest street protests in two decades last month, when more than a million people took to the streets to condemn corruption, poor public services and the cost of hosting the 2014 World Cup.
The 1,000-resident Varginha slum is one of a dozen favelas where police have evicted drug gangs and restored security ahead of next year's World Cup and the 2016 Olympic Games.
The pope, referring to the police drive to restore order in the city's violence-wracked favelas, said tough tactics are not a solution to poverty.
"No amount of pacification will be able to last, nor will harmony and happiness be attained in a society that ignores, pushes to the margins or excludes a part of itself," he said.
"A society of that kind simply impoverishes itself. It loses something essential. Let us always remember this: only when we are able to share do we become truly rich."
The pope, who has promoted a "poor Church for the poor," was greeted in the slum with banners, flags and two two-meter (six-foot) statues representing the pontiff and the venerated Black Virgin of Aparecida.
Protected by a watchful security team, he walked through the ramshackle streets, stopping to chat with delighted residents, kissing babies and accepting a flower garland around his neck.
The first Latin American pope also entered the humble house of a seven-member family.
"This is going to change my life for the better," said 59-year-old Carmen Mendoca shortly before the pontiff dropped in. "I am waiting for him with cake and coffee."
He then blessed the altar of the tiny, 62-seat Sao Jeromino Emiliani church.
"I would have liked to knock on every door, to say good morning, to ask for a glass of water, to take a coffee, but not cachaca," he told the crowd, referring to the favored local liquor.
The slum's residents are divided roughly equally between Catholics and adherents of Evangelical churches, which have made major inroads in recent years in the world's largest Catholic nation.
Vatican officials have made no secret of the fact that the pope's first trip abroad since his election aims to re-energize his flock.
In the morning, the pope met with athletes, received the keys to the city and blessed the Olympic flag.
He later addressed thousands of fellow Argentines gathered in Rio's modernist, cone-shaped cathedral, where he hammered home his message that clergymen must live and work among ordinary people.
"I want the Church, parish colleges, the institutions to go into the streets," he said.
The pope's desire to connect with ordinary Brazilians caused scenes of chaos upon his arrival on Monday, when throngs were able to stop his car and reach inside his open window as he arrived from the airport.
Since then, Rio Mayor Eduardo Paes said steps were being taken to avoid a repeat of such "deplorable incidents."