Margot Wendice is explaining to her lover Mark Halliday exactly what caused her to change his mind about leaving her husband Tony. From out of nowhere her husband started becoming less distant and more attentive and made her rethink the whole idea that she was trapped in a loveless marriage.
Tony is a former tennis pro who has become a successful salesman. When he arrives home from work, he apologizes for having to back out of their plans for the evening, but he’s got an important business meeting he has to attend to after-hours. He then suggests that Margot and Mark hit the town by themselves. He also extends an invitation to Mark to attend the banquet being thrown at his club the following evening.
No sooner have Margot and Mark left than Tony is on the phone ringing up Capt. Lesgate on the matter of the car he is trying to unload. Tony gets him to agree to meet for further negotiation on the terms of the sale, but when Lesgate shows up Tony surprises him with the news that they attended Cambridge together and remembers all the shady dealings he conducted back then when he was known as C.A. Swann. He then proceeds to tell Lesgate that he stole an incriminating letter written by his wife and blackmailed her as a way of confirming her affair with Mark before blackmailing Lesgate into agreeing to murder Margot. He also lures the man into his scheme with the promise of big money. Lesgate reluctantly agrees and Tony explains his plan.
While he and Mark attend the banquet the next evening, Lesgate will keep an eye on the apartment and after making sure Margot has retired for the evening, enter using a house key he will provide. Tony will then make a phone call which Margot will get up to answer. When she does, Lesgate will come out from behind the drapes and strangle her. Once sure she’s dead, Lesgate will whistle into the phone to signal Tony and then hang up. Before exiting the apartment, he must remember to open the garden window and then replace the key beneath the carpet in the stairway.
While enjoying cocktails the following evening, Mark claims that even though he can write the perfect murder as part of his job as a TV writer, he realizes that in real life there would always be one detail that gets overlooked, thus giving the culprit away. Before heading out to the banquet, Tony steals Margot’s house key from her purse and talks her into staying home in order to clip out articles to put in his scrapbook. When they reach the club, Tony makes the excuse of needing to call his boss, but actually places a phone call to his apartment. Lesgate shows up as planned, concealing himself behind the drapes as he waits.
When the phone rings, Margot shows up to answer and Lesgate attempts to strangle her with a scarf, but in the struggle she manages to grab a pair of scissors on the desk near the phone and stab him. Lesgate then stumbles and falls straight down upon the scissors, effectively helping to kill himself. On the other end of the line, Tony has been listening to his perfectly conceived murder plan go hopeless off the rails. He decided to call out for Margot who, recognizing his voice, explains everything that happened. He tells her to rest and leave the business of dealing with the police until he has returned. After calling the cops, he convinces here to go back to bed and rest. In the interim, he takes what he assumes is Margot’s key from the pocket of Lesgate and places it inside her purse, plants the incriminating letter on Lesgate and replaces the scarf he used as a weapon with one of Margot’s stockings.
The next day, Tony convinces Margot not to disclose the fact that he advised her not to call the police right away. Chief Inspector Hubbard questions them, making note of a few points in Margot’s story that seem to conflict with each other. The inspector insists that her attacker must surely have entered the apartment through the door and then Tony lies about having seen the man sometime around the time that his wife’s purse was stolen with the intimation that he was able to make a copy of her house key. Since no key was discovered on the body, Hubbard dismisses this idea and proceeds to arrest Margot on the premise that she murdered Lesgate to stop him from carrying out a blackmail scheme. At the trial, Margot is convicted and sentenced to death.
The day before the scheduled execution, Mark stops by Tony’s place with a story he’s come up with that could potentially stay the execution. Tony listens in disbelief as Mark unfurls a story that follows the narrative of what really did happen that fateful night. All Tony can do is dismiss the story as unrealistic. When Inspector Hubbard shows up, Mark hides in the bedroom and listens as the policeman makes inquiries into large sums of money that Tony has been spending lately. When he further inquires about the whereabouts of Tony’s briefcase, Tony’s response is that he lost it. Mark, however, sees the briefcase on the bed and is it filled with cash. Mark moves to keep Hubbard from leaving by explaining his little theory, but Tony quickly devises a cover story for the appearance of the cash by suggesting that it was Margot’s own blackmail payment to Lesgate. This seems to make more sense to Hubbard than Mark’s outlandish theory which prompts his angry exit.
Before leaving, Hubbard furtively replaces Tony’s raincoat with his own. When Tony leaves, he uses the key gain entry into the apartment with Mark in tow. Hubbard has long since discovered that the key Tony placed into Margot’s purse was the latchkey used by Lesgate and that the key he used to unlock the front door was put back in its hiding place under the rug. With this knowledge in hand, Hubbard concocted a ruse to draw Tony into his trap.
Officers show up at Tony’s apartment with Margot and watch as she tries without success to unlock the door using the key that was in her purse. They then enter through the garden window which suggests she had no idea of the existence of the hidden. The purse is then returned to the police station where Tony picks it up upon discovering he has lost his key. The key from the purse will not unlock the door, however, and so he goes to find the hidden key in order to let himself in all the time being watched by the police. Tony’s knowledge of the hidden is all the proof needed to confirm his collusion with Lesgate to murder his wife. With all escape route impassable, Tony decides instead to make one last drink and admit that he could not devise the perfect murder and offers congratulations to Hubbard for a job well done.