American pulp Western writer Holly Martins (Joseph Cotten) arrives in Allied-occupied Vienna seeking his childhood friend, Harry Lime (Orson Welles), who has offered him a job.
Upon arrival he discovers that Lime was killed just days earlier by a speeding car while crossing the street. Martins attends Lime's funeral, where he meets two British Army Police: Sergeant Paine (Bernard Lee), a fan of Martins' pulp fiction, and his superior, Major Calloway (Trevor Howard), who says Lime was a criminal and suggests Martins leave town.
A book club subsequently approaches Martins, requesting that he give a lecture to the club and offering to pay for his lodging. Viewing this as an opportunity to clear Lime's name, Martins decides to remain in Vienna. He encounters Lime's friend, "Baron" Kurtz (Ernst Deutsch), who tells Martins that he, along with another mutual friend, Popescu (Siegfried Breuer), carried Lime to the side of the street after the accident. Before dying, Lime asked Baron and Popescu to take care of Martins and Anna Schmidt (Alida Valli), Lime's actress girlfriend.
Beginning to suspect that Lime's death was not an accident, Martins goes to see Anna. She accompanies Martins to question the porter at Lime's apartment building. The porter claims Lime was killed immediately and could not have given instructions before dying. He also states that a third man helped carry the body.
Martins berates the porter for not being more forthcoming with the police with what he knows. The police, searching Anna's flat for evidence, find and confiscate her forged passport and detain her.
Martins visits Lime's "medical adviser", Dr Winkel (Erich Ponto), who says that he arrived at the accident after Lime was dead, and only two men were present. Later, the porter secretly offers Martins more information but is murdered before their arranged meeting. When Martins arrives, unaware of the murder, a young boy recognises him as having argued with the porter earlier and points this out to the gathering bystanders, who become hostile, then mob-like.
Escaping from them, Martins returns to the hotel, and a cab immediately takes him away. He fears the cab will take him to his death, but the cab takes Martins to the book club. From the audience, Popescu asks him about his next book, and Martins retorts that it will be called The Third Man, "a murder story" inspired by facts. Popescu tells Martins that he should stick to fiction. Martins sees two thugs approaching and flees.
Calloway again advises Martins to leave Vienna, but Martins refuses and demands that Lime's death be investigated. Calloway reluctantly reveals that Lime was a black marketeer, who greatly diluted penicillin he stole from military hospitals and sold it on the black market, killing many.
In postwar Vienna, antibiotics were new and scarce outside military hospitals and commanded a very high price. Calloway's evidence convinces Martins, who agrees to leave.
Martins learns that Anna will be deported to the Soviet sector of Vienna. Upon leaving her apartment, he notices someone watching from a dark doorway; a neighbour's lit window briefly reveals the person to be Lime, who flees, ignoring Martins' calls. Martins summons Calloway, who deduces that Lime has escaped through the sewers. The British police exhume Lime's coffin and discover that the body is that of Joseph Harbin, an orderly who stole penicillin for Lime.
The next day, Martins meets with Lime, and they ride Vienna's Ferris wheel, the Wiener Riesenrad. Lime obliquely threatens Martins, and in a monologue on the insignificance of his victims, reveals the full extent of his ruthlessness. He again offers a job to Martins and leaves. Calloway asks Martins to help lure Lime out to capture him, and Martins agrees, asking for Anna's safe conduct out of Vienna in exchange. However, Anna refuses to leave and remains loyal to Lime.
Exasperated, Martins decides to leave but changes his mind after Calloway shows Martins the children who are victims of Lime's diluted penicillin, now dying of meningitis.
Lime arrives at his rendezvous with Martins, but Anna warns Lime. He tries again to escape through the sewers, but the police are there in force. Lime shoots and kills Paine, but Calloway shoots and wounds Lime. Badly injured, Lime drags himself up a ladder to a street grating exit but cannot lift it. Martins picks up Paine's revolver, follows Lime, reaches him, but hesitates. Lime looks at him and nods. A shot is heard.
Later, Martins attends Lime's second funeral. At the risk of missing his flight out of Vienna, Martins waits to speak to Anna. She approaches him from considerable distance, but she ignores him and walks past him.