Tony Wendice (Ray Milland), a former English professional tennis player, is married to wealthy socialite Margot (Grace Kelly), who has had an affair with American crime-fiction writer Mark Halliday (Robert Cummings). When Tony retires in response to her complaints about his busy schedule, he secretly discovers the affair and decides to murder her, both for revenge and to ensure that her money will continue to finance his comfortable lifestyle.
Tony arranges to meet an acquaintance from the University of Cambridge, Charles Alexander "C. A." Swann (Anthony Dawson), who has become a small-time criminal. Tony has secretly been following Swann so he can blackmail him into murdering Margot. Tony tells Swann about Margot's affair. Six months before, Tony stole her handbag, which contained a love letter from Mark, and anonymously blackmailed her. After tricking Swann into leaving his fingerprints on the letter, Tony offers to pay him £1,000 to kill Margot; if Swann refuses, Tony will turn him in to the police as Margot's blackmailer.
When Swann agrees, Tony explains his plan: the following evening he will take Mark to a party, leaving Margot at home and hiding her latchkey outside the front door of their flat. Swann is to sneak in when Margot is asleep and hide behind the curtains in front of the French doors to the garden. At eleven o'clock, Tony will telephone the flat from the party. Swann must kill Margot when she answers the phone, open the French doors, leave signs suggesting a burglary gone wrong, and exit through the front door, hiding the key again.
The next night, Swann enters the flat while Margot is in bed, and waits. At the party, Tony discovers his watch has stopped, so he phones the flat later than intended. When Margot comes to the phone, Swann tries to strangle her with his scarf, but she manages to grab a pair of scissors and kill him. She picks up the telephone receiver and pleads for help. Tony tells her not to do anything until he arrives home. When he returns to the flat, he calls the police and sends Margot to bed. Before the police arrive, Tony moves what he thinks is Margot's latchkey from Swann's pocket into her handbag, plants Mark's letter on Swann, and destroys Swann's scarf, replacing it with Margot's own stocking in an attempt to incriminate her.
The following day, Tony persuades Margot to hide the fact that he told her not to call the police immediately. Chief Inspector Hubbard (John Williams) arrives and questions the Wendices, and Margot makes several conflicting statements. When Hubbard says Swann must have entered through the front door, Tony falsely claims to have seen Swann at the time Margot's handbag was stolen, and suggests that Swann made a copy of her key. Hubbard does not believe this because no key was found on Swann's body. Hubbard arrests Margot after concluding that she killed Swann for blackmailing her. Margot is found guilty and sentenced to death.
Some months later, on the day before Margot's scheduled execution, Mark visits Tony, saying he has devised a story for Tony to tell the police in order to save Margot's life. To Tony's consternation, Mark's "story" is what did actually happen: that Tony bribed Swann to murder Margot. Tony says the story is too unrealistic. Hubbard arrives unexpectedly, and Mark hides in the bedroom. Hubbard asks Tony about large sums of cash he has been spending, tricks him into revealing that his latchkey is in his raincoat, and inquires about Tony's attaché case. Tony claims to have lost the case, but Mark, still in the bedroom, finds it on the bed, full of banknotes. Deducing that the money was Tony's intended payoff to Swann, Mark stops Hubbard from leaving and explains his theory. Tony improvises another cover story by saying the cash was Margot's blackmail payment to Swann. Hubbard appears to accept Tony's explanation over Mark's theory, and Mark leaves angrily. Hubbard discreetly swaps his own raincoat with Tony's, and as soon as Tony leaves, he uses Tony's key to re-enter the flat, followed by Mark. Hubbard had already discovered that the key in Margot's handbag was Swann's latchkey, and deduced that Swann had put the key back in its hiding place after unlocking the door. Now suspecting Tony of having conspired with Swann, Hubbard has developed an elaborate ruse to confirm this.
Plainclothes policemen bring Margot from prison to the flat. She tries unsuccessfully to unlock the door with the key in her handbag, then enters through the garden, proving she is unaware of the hidden key. Hubbard has Margot's handbag returned to the police station, where Tony retrieves it after discovering that he has no key. The key from Margot's bag does not work, so he uses the hidden key to open the door, proving his guilt. With his escape routes blocked by Hubbard and another policeman, Tony calmly makes himself a drink and admits defeat.