An American pulp writer, Holly Martins, arrives in Vienna shortly after the end of World War II. The city is divided into Russian, American, British and French zones and patrolled by military policemen from each country. Holly has come to work for a medical charity run by an old friend, Harry Lime, but when he arrives there's no sign of Harry.
Holly goes to his flat where the porter tells him that Harry's been killed in a car accident. Holly rushes to the city cemetery for the burial. Major Calloway, a British miltary policeman, takes Holly back into the city afterwards. In a bar, Calloway tells him that Harry was a racketeer.
Sergeant Paine takes Holly to Sacher's hotel where they meet Crabbin of the British Cultural Re-education Centre. Crabbin agrees to pay for Holly's stay if he'll deliver a lecture. Holly's called to the telephone to speak to Baron Kurtz. They meet at a café and Kurtz tells him that Harry's last words were to ask Kurtz to look out for Holly. Kurtz tells him that Harry's girlfriend is an actress.
Backstage at the Josefstadt Theatre Holly speaks to Anna Schmidt. Holly voices his suspicions about Harry's death. They visit the porter again, who contradicts Kurtz: Harry was killed instantaneously and there was a third man carrying the body.
At Anna's flat Calloway confiscates letters and her papers. She explains to Holly that they're forged: she's Czechoslovakian and subject to repatriation by the Russians. Before she's taken away she mentions Dr Winkel.
Holly goes to Winkel's home where the doctor concedes that Harry's injuries might have been the result of foul play. At police HQ Calloway questions Anna about a letter she wrote to one Joseph Hardin, instructing him to meet Harry.
At the Casanova Club Kurtz introduces Holly to Popescu. Holly questions him about the third man, explaining that the porter is the source of his information. Later Popescu, Kurtz and Winkel are seen meeting a man on a bridge. Meanwhile Holly paces around the street outside Harry's building and the porter tells him to come back later. When Holly and Anna do return, there's a crowd outside the door. The porter has been murdered.
At Sacher's Holly is bundled into a car. He thinks he's going to be murdered but he's dropped off at the British Cultural Centre where Crabbin and an audience are waiting for his lecture. It's a fiasco. Popescu arrives with two heavies. Holly escapes and goes to Calloway's office where the major explains in detail how Harry was involved in selling watered-down penicillin. Many died and others were mentally incapacitated.
Holly gets drunk in a bar then stumbles to Anna's and tells her he's in love with her. She shrugs him off. When he leaves he sees a man's feet in a doorway. He shouts, prompting a woman to open a window. The light in her flat illuminates Harry. He runs off and disappears. Later Holly recounts the story to Calloway who doesn't believe him until he notices a kiosk, which is an entrance to the city's sewers.
Calloway disinters the body supposed to be Harry's. It's Harbin, a medical orderly involved in the racket. Anna is picked up and on the way to Calloway's office Holly tells her that Harry's alive. Later Holly tells Kurtz to pass a message on that he'll meet Harry at the ferris wheel. After a short wait Harry arrives. He admits his racketeering but offers to cut Holly in.
Holly tells Calloway about the meeting but refuses to help capture him. But when a Russian official, Brodsky, comes in threatening to claim Anna, Holly relents. He looks on as Anna boards a train. When she sees him she confronts him and realises that Calloway has enabled her to escape only because Holly is cooperating with him. She rips up her new papers.
Holly goes back to Calloway and backs out of the deal. Calloway offers to drive him to the airport but stops off at the hospital where he shows Holly children demented by the bootleg penicillin. Later Holly waits for Harry at a café while police lurk outside. Anna enters just before Harry and warns him off.
Harry escapes to the sewers, the police in pursuit. He shoots Paine dead but is wounded by Calloway. Holly finishes Harry off. At the cemetery Holly and Anna finally see Harry's body into the ground. Holly waits for her by the road leading into the city, but she walks past him and away, without even a glance.