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.
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.
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.
Caio Junqueira was initially considered too old for the part of Neto. He then auditioned for the part of Capitão Fábio, but opted for a performance that would convince the casting staff he could still be a viable choice for Neto, in spite of his age. He successfully conveyed that message, and Milhem Cortaz got to play Fábio instead.
The character Roberto Nascimento was named after Sandro Nascimento, the criminal who died right after being arrested by Rio de Janeiro police for hijacking a bus. His life was depicted in Ônibus 174 (2002), which was also directed by this film's director, José Padilha.
The university where part of the film was shot is PUC, located in the pleasant neighborhood of Gávea in at Rio de Janeiro, a very traditional elite school considered the best private university in Brazil and one of the best educational institutions in South America. This is where André Batista, one of the film's screenwriters, attended law school. He was a member of BOPE and was the inspiration for the character of André Matias, an honest man who finds himself torn between his life as a BOPE member and his lifelong dream of being a lawyer.