Globo TV showed aerial footage of paralyzed traffic stretching in huge lines along the Linha Amarela, a crucial expressway that links the international airport with the western limits of Rio.
The highway was blocked when elite police poured into the City of God favela following the death earlier of a police officer. Another big artery, the Grajau Jacarepagua, was paralyzed after security forces entered another favela, Lins.
The snarl-up lasted about two hours.
Heavily armed police and elite BOPE units patrolled the streets inside City of God, a neighborhood made famous by a 2002 movie, an AFP reporter said.
Clashes with armed gangs, which control Rio's drug business, resulted in fierce shootouts earlier. The Onde Tem Tiroteio app, which gives realtime updates on shootings in the city, posted a video of motorists abandoning their vehicles in panic near City of God as the firefight raged.
One policemen was hit by a bullet and taken to hospital, Globo TV reported.
Rio, which hosted the Olympic Games in 2016, is struggling to control violent crime. In February, the armed forces were put in charge of all local security to try and boost the police.