RIO DE JANEIRO (AP) — Pope Francis has shown the world his rebellious side, urging young Catholics to shake up the church and make a "mess" in their dioceses by going out into the streets to spread the faith. It's a message he put into practice by visiting one of Rio's most violent slums and opening the church's World Youth Day on a rain-soaked Copacabana Beach.

Francis was elected pope on a mandate to reform the church, and in four short months he has started doing just that: He has broken long-held Vatican rules on everything from where he lays his head at night to how saints are made. He has cast off his security detail to get close to his flock, and his first international foray as pope has shown the faithful appreciate the gesture.

He's going further Friday, meeting with a small group of young convicts. He'll also hear confessions from some Catholic youth and then head back to Copacabana beach for a Stations of the Cross procession.

Dubbed the "slum pope" for his work with the poor, Francis received a rapturous welcome in the Varginha shantytown on Thursday, part of a slum area of northern Rio so violent it's known as the Gaza Strip. The 76-year-old Argentine seemed entirely at home, wading into cheering crowds, kissing people young and old and telling them the Catholic Church is on their side.

"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 soccer 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."

It was a message aimed at reversing the decline in the numbers of Catholics in most of Latin America, with many poor worshippers leaving the church for Pentecostal and evangelical congregations. Those churches have taken up a huge presence in favelas, or shantytowns such as Varginha, attracting souls with nuts-and-bolts advice on how to improve their lives.

Story continues

The Varginha visit was one of the highlights of Francis' weeklong trip to Brazil, his first as pope and one seemingly tailor-made for the first pontiff from the Americas.

The surprise, though, came during his encounter with Argentine pilgrims, scheduled at the last minute in yet another sign of how this spontaneous pope is shaking up the Vatican's staid and often stuffy protocol.

He told the thousands of youngsters, with an estimated 30,000 Argentines registered, to get out into the streets and spread their faith and make a "mess," saying a church that doesn't go out and preach simply becomes a civic or humanitarian group.

"I want to tell you something. What is it that I expect as a consequence of World Youth Day? I want a mess. We knew that in Rio there would be great disorder, but I want trouble in the dioceses!" he said, speaking off the cuff in his native Spanish. "I want to see the church get closer to the people. I want to get rid of clericalism, the mundane, this closing ourselves off within ourselves, in our parishes, schools or structures. Because these need to get out!"

Apparently realizing the radicalness of his message, he apologized in advance to the bishops at home.

Later Thursday, he traveled in his open-sided car through a huge crowd in the pouring rain to a welcoming ceremony on Copacabana beach. It was his first official event with the hundreds of thousands of young people who have flocked to Rio for World Youth Day. Vatican officials estimated the crowd at 1 million.

Cheering pilgrims from 175 nations lined the beachfront drive to catch a glimpse of the pontiff, with many jogging along with the vehicle behind police barricades. The car stopped several times for Francis to kiss babies — and take a long sip of his beloved mate, the traditional Argentine tea served in a gourd with a straw, which was handed up to him by someone in the crowd.

After he arrived at the beach-front stage, though, the crowd along the streets melted away, driven home by the pouring rain that brought out vendors selling the plastic ponchos that have adorned cardinals and pilgrims alike during this unseasonably cold, wet week.

In an indication of the havoc wreaked by four days of steady showers, organizers made an almost unheard-of change in the festival's agenda, moving the Saturday vigil and climactic Sunday Mass to Copacabana Beach from a rural area 30 miles (50 kilometers) from the city center. The terrain of the area, Guaratiba, had turned into a vast field of mud, making the overnight camping plans of pilgrims untenable.

The news was welcome to John White, a 57-year-old chaperone from the Albany, New York, diocese who attended the past five World Youth Days and complained that organization in Rio was lacking.

"I'm super relieved. That place is a mud pit and I was concerned about the kid's health and that they might catch hypothermia," he said. "That's great news. I just wish the organizers would have told us."

Francis' visit to the Varginha slum followed in the footsteps of Pope John Paul II, who visited two such favelas during a 1980 trip to Brazil, and Mother Teresa, who visited Varginha itself in 1972. Her Missionaries of Charity order has kept a presence in the shantytown ever since.

Like Mother Teresa, Francis brought his own personal history to the visit: As archbishop of Buenos Aires, then-Cardinal Jorge Mario Bergoglio frequently preached in the poverty-wracked slums of his native city, putting into action his belief that the Catholic Church must go to the farthest peripheries to preach and not sit back and wait for the most marginalized to come to Sunday Mass.

Francis' open-air car was mobbed on a few occasions as he headed into Varginha's heavily policed, shack-lined streets, 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 another offering — a scarf from his favorite soccer team, Buenos Aires' San Lorenzo.

"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."

Addressing Varginha's residents, Francis acknowledged that young people in particular have a sensitivity toward injustice.

"You are often disappointed by facts that speak of corruption on the part of people who put their own interests before the common good," Francis told the crowd. "To you and all, I repeat: Never yield to discouragement, do not lose trust, do not allow your hope to be extinguished."

It was a clear reference to the violent protests that paralyzed parts of the country in recent weeks as Brazilians furious over rampant corruption and inefficiency within the country's political class took to the streets.

Francis blasted what he said was a "culture of selfishness and individualism" that permeates society today, demanding that those with money and power share their wealth and resources to fight hunger and poverty.

"It is certainly necessary to give bread to the hungry — this is an act of justice. But there is also a deeper hunger, the hunger for a happiness that only God can satisfy," he said.

___

Associated Press writer Bradley Brooks contributed to this report.

___

Nicole Winfield on Twitter: www.twitter.com/nwinfield