Updated

Brazil is rolling out a massive security operation to protect Pope Francis during his visit next week to deter any repetition of last month's social unrest.

More than 1.5 million pilgrims from around the world are expected to flock to Rio de Janeiro for the July 22-28 visit during World Youth Day (WYD), a major Roman Catholic youth fest.

The Defense Ministry, which is coordinating security, is boosting from an initial 8,500 to 10,266 the number of army, air force and navy personnel to be deployed for the high-profile event.

The troop increase was decided due to "the massive street protests in June," according to a ministry spokesman, speaking on condition of anonymity.

In addition to the armed forces, state security officials will launch "the biggest police operation in the city's history," said Roberto Alzir Dias Chaves, the undersecretary for major events.

So "7,000 police will beef up the city's 12,000 police, in addition to 1,700 members of the elite National Force and units of the civilian, highway and federal police forces," he said last week.

"It will be a bigger mobilization than what occurred two years ago at the Madrid WYD," he added, noting that the plan was developed well before the June street protests.

The nationwide turmoil, held during the Confederations Cup, brought more than one million Brazilians onto the streets of various cities to demand an end to political corruption and greater investment in public services rather than in sporting events such as next year's World Cup.

The unprecedented protests, coordinated via social media, were often marred by violence and acts of vandalism.

And officials initially feared that the unrest might flare anew during the papal visit to the world's largest mostly Catholic country.

But presidential chief of staff Gilberto Carvalho and Catholic leaders are now confident that this will not happen "given the very nature of the event".

"The pope will be safe here. And not because of the armed forces, but because of our people, our democracy, the sympathy he inspires since he represents a new hope not just for the Church but for mankind," said Carvalho.

As a sign of easing concern, the pontiff will not use his traditional closed popemobile but instead two open jeeps, to be closer to the people.

However press reports said a so-called "beija??o", a demonstration at which gay couples kiss each other on the lips, or massive distributions of condoms might take place along the papal motorcade's route.

In Rio, the pontiff will tour a small shantytown in the northern district.

But the biggest security concern will focus on events on Copacabana beach where the pope will deliver a welcoming speech for the youth and in Guaratiba, 40 kilometers (25 miles) west of Rio where a papal mass and youth vigil will be held.

On July 24, the pontiff will travel to Aparecida, a pilgrimage site in Sao Paulo state, where more than 4000 troop will provide security.

The defense ministry spokesman said the armed forces will handle security in 10 areas, including control of the airspace, border surveillance, chemical and biological weapons, explosives trade, maritime defense and cyber-security.