About 1,500 elite police commandos backed by tanks and helicopters stormed two favelas, or slum towns, in Rio de Janeiro in a spectacular military operation to retake control of the drug gang strongholds - but the criminals had already left.

No shots were fired as security forces swamped Jacarezinho and Manguinhos, taking control of the streets in less than 20 minutes.

Three people were arrested and 60kg of cocaine seized but just hours later, drug dealers were back on their corners, O Globo newspaper reported.

Jacarezinho and Manguinhos, home to about 70,000 people, are usually off-limits for Brazilian security forces. The favelas are controlled by the Comando Vermelho drug gang and crack cocaine trafficking is rife.

Despite having little to show for their efforts, security forces raised the Brazilian flag in Manguinhos' central square and struck up the national anthem as a sign of victory.

Brazil is the second largest consumer of cocaine in the world, according to a report from the Sao Paulo Federal University.

The raid was part of the "pacification" programme launched by the government to oust criminal gangs from 40 favelas and secure the country's most dangerous regions ahead of the 2015 World Cup and 2016 Olympics.

Thirty favelas have been raided since the programme was launched in 2008. About 30 people were killed in 2010 when security forces entered the slums of Alemao.