The movie was originally meant to have Capitão Nascimento as a secondary character and Neto and Matias as the main characters. It was only after shooting was finished that director José Padilha and writer Bráulio Mantovani realized how impressed they were with Wagner Moura's charisma on screen and decided to edit the film with his voice over, changing the focus of the story and turning Capitão Nascimento into a main character.
The character of André Matias was based on screenwriter André Batista, and the character of Nascimento was based on screenwriter Rodrigo Pimentel, both of them former members of the BOPE squad.
André Ramiro was called to audition after a friend of his suggested his name for the casting staff. His friend didn't get a part in the movie, but Ramiro went on to play a major part in it, even though he had no previous acting experience.
This film was already a best-seller almost three months before its official release. Illegal copies of what the director called the "3rd cut" flooded the streets of all major capitals in Brazil, for the equivalent of $5.00 apiece. An investigation revealed that the original DVD was stolen from the Company Drei Marc, which did the subtitles. It was estimated that at least three million people watched the bootleg version, which is 600,000 more than saw it during its theatrical run. However, it was the biggest box-office hit in Brazil that year.
During the shooting of the film, a van with 90 firearms (30 real and 60 prop guns) was robbed in the hill of Chapéu Mangueira. Teams from the local police stormed the Favela Pavão-Pavãozinho, in Copacabana, to recover the guns, but the operation was only partially successful.