Some 3,000 police and soldiers raided and took over two of Brazil's biggest shantytowns Sunday as part of a crackdown against armed drug gangs and security preparations for the 2014 World Cup and 2016 Olympics.

Soldiers and police backed by armored personnel carriers and helicopters completed the takeover Sunday even as two major drug gang bosses and members were arrested days before when entrance and exit points to the Rocinha and Vidigal slums in Rio de Janeiro were cordoned off.

"We have taken over areas that for 30 or 40 years were in the hands of ... a parallel power. This (Rocinha) is a very large area. It's one of the biggest shantytowns in the Americas if not the world. We're returning dignity and territory to people," said Rio's shantytown pacification chief, Jose Mariano Beltrame, according to the Associated Press.

"Rocinha is one of the most strategically important points for police to control in Rio de Janeiro," Paulo Storani, a security consultant and former captain in the elite BOPE police unit leading the invasion, told AP. "The pacification of Rocinha means that authorities have closed a security loop around the areas that will host most of the Olympic and World Cup activities."

There are more than a thousand shantytowns in Rio and a third of the city's 6 million population lives there. The raid continues as police and troops secure parts located on hills and mountainside jungle.

Roadblocks in Rocinha put up days earlier caught No. 2 gang leader, Sandro Luiz de Paula, whose three-story house stood in stark contrast to dilapidated shacks. On Thursday, Rio's most wanted drug trafficker, Antonio Bonfim Lopes, was arrested inside the trunk of a car trying to cross a checkpoint.

The massive raid also took down the Friends of Friends drug gang, which sells $50 million worth of drugs to tourists in the neighboring beaches of Leblon, Ipanema and Copacabana.

The police and soldiers will remain in the shantytowns until they get rid of all the drug gangs and illegal weapons there, according to Alberto Pinheiro Neto, head of operations for the military police.

The Rocinha shantytown in Rio de Janeiro is considered the largest in South America with nearly 100,000 residents.