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 incarceration of a Mr. Harry Buttle instead of the suspected terrorist, Harry Tuttle. When Sam visits Mr. Buttle's widow, 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 has gotten sick 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 in Tuttle's place to bureaucrats that would not admit a mistake on their side. 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 transfer 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. He 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. As they try to disappear into the crowds Tuttle's disappearance is more surreal and mysterious. The scene becomes 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 either. 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 like 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 he 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.
However, it is quickly revealed this 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. Jack gives up trying to torture Sam, and Sam is left with a smile on his face, humming "Brazil" as Jack moves Mr. Helpmann in his wheelchair away from the scene.