Police and alleged drug traffickers exchanged fire in the Complexo do Alemao shantytown after police were shot at. The dead included two youths and a police officer. Another policeman was injured in the altercation.
O Globo reported a local policeman said, "They use radios to tell each other where there's a patrol and when they spot a small group of officers, they give orders to attack."
Complexo do Alemao, home to 100,000 people, is one of the largest favelas in Rio and the scene of frequent shootings.
Brazilian authorities have dedicated additional resources to ensure security during the World Cup.
2014: The Year in Music [PHOTOS]