The story is set in a dystopian near-future of an indeterminate year of the 21st century in a nameless authoritarian European country during the Christmas season. Terrorist bombings are frequent and the government's war on these enemies of the state has lasted for a few decades. In a government office a man sitting in a room full of teletype machines swats a fly on the ceiling; the fly falls off the ceiling and into one of the teletypes, changing the name on one printout from "Tuttle" to "Buttle."
At the Buttle home the family is peacefully trimming their Christmas tree. Men burst into the apartment upstairs and cut a large hole in the floor, dropping down into the Buttle's apartment. Buttle is arrested and taken away.
Sam Lowry (Jonathan Pryce) is a low-level government employee, often daydreaming of saving a beautiful maiden. One day he is assigned the task of trying to rectify an error created by a government mishap, causing the arrest and incarceration of a Mr. Harry Buttle instead of a suspected terrorist, Harry Tuttle.
When Sam visits Mr. Buttle's widow, he finds the woman in shock in her living room. He tries to give her a compensation check but she's too upset and hysterically asks where her husband is.
He discovers Jill Layton (Kim Greist), the upstairs neighbor of the Buttles, is the same woman as in his dreams. Jill is trying to help Mrs. Buttle find out what happened to her husband, but she has gotten tired of dealing with the bureaucracy, while unbeknownst to her, she is now, in turn, considered a terrorist friend of Tuttle for trying to report the mistake of Buttle's arrest. When Sam tries to approach her, she is very cautious and avoids giving Sam full details, worried the government will track her down.
During this time, Sam comes in contact with the real Harry Tuttle (Robert De Niro), a renegade air conditioning specialist who once worked for the government but left due to the amount of paperwork. Tuttle helps Sam deal with two government workers who are taking their time fixing the broken air conditioning in Sam's apartment.
Sam determines the only way to fully learn about Jill is to accept a promotion to "Information Retrieval" where he would have access to her classified records as she is considered a terrorist. He requests the help of his mother Ida (Katherine Helmond), vainly addicted to rejuvenating plastic surgery under the care of cosmetic surgeon Dr. Jaffe (Jim Broadbent), as she has connections to high ranking officers and is able to help her son get the position. His mother is delighted as she used to be frustrated at her son's prior lack of ambition, and the promotion Sam receives is one his mother has previously arranged for him but that Sam has declined before.
Sam eventually obtains Jill's records and tracks her down before she gets in trouble, then falsifies her records to make her appear deceased, allowing her to escape the bureaucracy. The two share a romantic night together before Sam is apprehended by the government at gun-point for misusing his position.
Sam is taken to be tortured by his old friend, Jack Lint (Michael Palin), as he is now considered part of an assumed terrorist plot including Jill and Tuttle. However, before the torturing process can start, Tuttle and other members of the resistance shoot Jack and save Sam, blowing up the Ministry building as they flee in a hail of gunfire. As they try to disappear into the crowds, Tuttle's disappearance is more surreal and mysterious.
The scenes become more dream-like as Sam runs to his mother at a funeral. The funeral is described as that of Mrs. Terrain (Barbara Hicks), a friend of his mother's who over the course of the film has suffered increasing "complications" as she has submitted to the "acid treatment" of Dr. Chapman (Jack Purvis), a rival of Dr. Jaffe and whose technique Sam's mother does not hold in high regard. Other than Mrs. Terrain, recently deceased due to her cosmetic surgery gone wrong, Sam's mother, thanks to Dr. Jaffe's repeated surgery, now seems as if she's in her 20s again, looking exactly like Sam's love interest Jill, and is surrounded by a flock of juvenile admirers younger than Sam himself. She refuses to help and, falling into Mrs. Terrain's seemingly bottomless coffin, he then continues to run from the police in streets that more and more resemble the concrete and brick walls of his nightmare daydreams.
When Sam finds himself surrounded on three sides by the police and the imaginary monsters of his nightmares, he turns to the only escape way left and climbs up a seemingly unsurmountable pile of old flex-ducts such as those running the world of Brazil, and finds sanctuary in a trailer driven by Jill, whereupon the two leave the city together and settle in the countryside, free from their past lives.
However, it is quickly revealed all of this including the happy ending is all happening inside Sam's head when in front of the idyllic scene, two faces come into view staring at the camera, that of Jack and of Mr. Helpmann (Peter Vaughan), who as Deputy Minister of the Ministry of Information is the system's highest official we see in the film. What they are looking at, as they now realize, is Sam having become insane at Jack's hands. Apparently the whole escape from the Ministry of Information and the scenes afterwards were all part of a dream that Sam had while being tortured. Seeing that Sam is too far gone to reveal any more information, Jack gives up trying to torture Sam further. Sam is left still sitting in his chair with a smile on his face, humming "Brazil" as Jack moves Mr. Helpmann in his wheelchair away from the scene.