During the beach event, some 500 people held an anti-corruption protest in front of the Rio state governor’s luxurious apartment building.
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.”
Under tight security, he walked through the ramshackle streets, stopping to chat with delighted residents, kissing babies and accepting a flower garland around his neck.
He visited the humble house of a slum resident, Maria Lucia dos Santos da Penha, who said she told the pope that “this was the best gift I’ve ever had in my life.”
He then blessed the altar of the 62-seat Sao Jeromino Emiliani church, a tiny brick building that faces competition from the favela’s four Evangelical temples.
Later, addressing fellow Argentines gathered in Rio’s cone-shaped cathedral, the pope hammered home his message that clergymen must live must live and work among ordinary people.
“I want the Church, parish colleges, the institutions to go into the streets,” he said.
The pope returns to Copacabana on Friday for a re-enactment of the Stations of the Cross.