João do Santo Cristo, Fabrício Boliveira, grows up on a poor farm in Bahia. His father is shot and killed by a police officer as punishment for hurting the cop’s brother, who had earlier roughened João up for trying to steal candy. After his mother dies, he leaves home for Brasília to find a relative he glimpsed in old photographs. Before leaving town, he kills his father’s killer and is caught by the police at the bus stop. After doing time, he finally heads to Brasília.
Upon arriving, he meets his cousin Pablo, César Troncoso, and begins taking small illegal tasks, like delivering drugs. Pablo also gives him weapons, including the Winchester 22 cited in the eponymous song. He also spends time working at a local carpentry to earn money. One drug delivery goes wrong and is stormed by the police; to escape, João breaks into an apartment, where he meets Maria Lúcia, Isis Valverde, a punk music enthusiast and daughter of a senator. Despite the circumstances, they fall in love after he returns to ask her out.
Maria Lúcia shows her friend the marijuana João can provide, and they immediately want more. This upsets Jeremias, Felipe Abib, a local drug dealer, who plots to have João killed with help from his partner and the corrupt Marco Aurélio, Antonio Calloni. Maria disapproves of João’s criminal life and demands that he stop. He promises, but he and Pablo soon start a larger drug empire in Brasília, taking advantage of their access to better marijuana.
To cement their grip, Jeremias and his allies organize a rockonha—a party that blends rock ’n’ roll with marijuana. João is invited but chased; Pablo and a friend are waiting nearby, ready to help, but Jeremias reveals he has many criminals and corrupt officers backing him. Pablo sacrifices himself by pushing João down the hill to buy him time, but João is captured anyway and sent to prison.
In prison, João endures a daily task: hold a newspaper in front of him so Marco Aurélio can photograph the inmates. One day, he seizes the moment, grabs Marco, frees himself and the other prisoners, and then kills Marco. He heads for a final assault on Jeremias and his drug empire. He begins by killing Jeremias’s right-hand man and seizing all his cocaine, leaving a taunting challenge for a duel.
At the final confrontation, three bags of cocaine hang from a football goal; João shoots them, escalating the clash. Maria arrives with João’s Winchester .22 and aims it at Jeremias, while João looks on. Jeremias shoots João first, leaving him wounded on the ground as Maria kneels by his side; Jeremias then shoots Maria as well. Jeremias turns to check on his cocaine, but João—still breathing—loads his Winchester and shoots Jeremias five times, killing him. The story ends with João and Maria dead beside each other, intercut with flashbacks of their moments together and with João’s narration.
In a post-credits scene, an alternate ending reveals a more song-driven finale: João and Jeremias stand face to face before a crowd, drawing their guns toward each other as Maria is shown in a brief spasm.