Pope Francis, dubbed the "slum pope" for his work with the poor, received a rapturous welcome from one of Rio de Janeiro's most violent shantytowns, and demanded the world's wealthy end the injustices that have left the poor on the margins of society.
The visit to the Varginha shantytown came hours before the pope was to preside over the opening of World Youth Day in a far different setting: Rio's Copacabana Beach.
Amid the stench of raw sewage and the shrieks of residents, Francis made his way through Varginha, part of a region so violent it is known as the Gaza Strip. He seemed entirely at home, wading into the cheering crowds, kissing residents young and old and telling them the Catholic Church was on their side.
It was a message aimed at reversing the trend in much of Latin America that has seen legions of Catholics, most of them poor, leaving the church for Pentecostal and evangelical congregations. These churches have taken up a huge presence in favelas, or shantytowns like Varginha, attracting souls with nuts and bolts advice on how to improve their lives.
"No one can remain insensitive to the inequalities that persist in the world," Francis told a crowd of thousands who braved a cold rain and stood in a muddy football field to welcome him. "No amount of peace-building 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."
Francis's open-air car was mobbed on a few occasions as he headed into Varginha's heavily policed streets lined with brick shacks, but he never seemed in danger.
He was showered with gifts as he walked down one of the slum's main drags without an umbrella to shield him from the rain. A well-wisher gave him a paper lei to hang around his neck and he held up a scarf from his favourite soccer team, Buenos Aires' San Lorenzo, that was offered to him.
"Events like this, with the pope and all the local media, get everyone so excited," said Antonieta de Souza Costa, a 56-year-old vendor and resident of Varginha. "I think this visit is going to bring people back to the Catholic Church."
It was one of the highlights of Francis's week-long trip to Brazil, his first as pope and one seemingly tailor-made for the first pontiff from the Americas.
Later, he was to preside over a welcoming ceremony on Copacabana beach for World Youth Day, his first official event with the hundreds of thousands of young people who have flocked to a rain-soaked Rio for the Catholic youth festival.