Retired Belgian detective Hercule Poirot and his friend and narrator, Captain Hastings, are vacationing at the Majestic Hotel in St. Loo, Cornwall. Poirot has declared his detective career over, even refusing an urgent plea from the Home Secretary. His resolve is tested when a small object strikes the terrace nearby. Poirot descends into the garden, stumbles, and is helped to his feet by a young woman named Nick Buckley, who owns End House, a crumbling estate on the nearby headland. Over cocktails, Nick casually mentions she has narrowly escaped death three times in recent days. After she departs with her friend Commander George Challenger, a naval officer, Poirot examines the hat she left behind and discovers a bullet hole through the brim. The "pebble" that struck the terrace was a spent bullet. Someone has just tried to kill Nick.
Poirot and Hastings visit End House to warn Nick. She is skeptical, treating the danger as a joke and admitting she has never heard of Poirot. He shows her the bullet and asks about the prior incidents: a picture that fell over her bed at night, a boulder dislodged on the cliff path, and tampered car brakes. When Nick checks the bureau drawer where her father's Mauser pistol was kept, she finds it gone, and her attitude shifts. Poirot reasons that the motive behind these attempts cannot be obvious, since an obvious motive would make such brazen attacks too risky.
Nick insists she has no enemies and cannot imagine who benefits from her death. End House is heavily mortgaged after two rounds of death duties, the inheritance taxes triggered by the successive deaths of her grandfather and brother. Her nearest relative is her cousin Charles Vyse, a local solicitor. Her closest friends include Frederica Rice, whose husband is absent and dissolute; Jim Lazarus, the son of a wealthy art dealer, devoted to Frederica; and Challenger, who has proposed to Nick without success. Nick reveals she made a will before an appendectomy six months earlier, leaving End House to Charles and everything else to Frederica. Poirot urges her to invite a trusted companion to stay, and she agrees to summon her Yorkshire cousin, Maggie Buckley.
Poirot spends the next days investigating. He confirms Nick's car was deliberately tampered with and demonstrates how easily anyone could enter End House through an unlocked garden gate. He and Hastings meet Mr. and Mrs. Croft, Australian tenants of the End House lodge. Mrs. Croft, bedridden with a spinal injury, gossips that Vyse is in love with Nick and that Nick has seemed "haunted." At Vyse's law office, Poirot discovers Vyse was absent at the time of the shooting. Vyse calls Nick's attachment to End House "fanatical devotion," contradicting Nick's practical attitude. One of them is lying.
The fireworks party at End House ends in tragedy. Nick greets her guests in a black dress draped with a vivid scarlet Chinese shawl. Maggie has arrived, a quiet, plainly dressed girl. At dinner, conversation turns to Michael Seton, an aviator missing on a round-the-world flight and presumed dead. Near the meal's end, Nick leaves to answer a telephone call and is absent for 20 minutes. Later, as guests watch fireworks, both Nick and Maggie go inside for warmer wraps. Unable to find her coat, Maggie takes Nick's scarlet shawl. Minutes later, Poirot and Hastings discover Maggie's body on the lawn, shot dead. The killer mistook her for Nick.
Nick, alive but devastated, is moved to a nursing home for her safety. Poirot compiles a detailed suspect list. After a sleepless night, he fixes on telling details: Nick's insomnia, her uncharacteristic black dress, and her remark that she had "nothing to live for." At the nursing home, Nick breaks down and reveals she was secretly engaged to Michael Seton. She hears confirmation of his death on the radio during her absence at dinner. The engagement was secret because Seton's uncle, Sir Matthew Seton, who despised women, financed the flight and would have cut Michael off. Sir Matthew recently died, leaving Michael a vast fortune. Before the flight, Seton made a will leaving everything to his fiancée, "Magdala Buckley," Nick's real first name. Poirot realizes that whoever kills Nick stands to inherit millions through her own will.
A search of End House fails to turn up Nick's will. Nick recalls that Mr. Croft helped her draft it and posted it to Vyse, who denies receiving it. Poirot sends Croft's fingerprint to Inspector Japp at Scotland Yard. In London, Seton's solicitor confirms the will leaves everything to "Miss Magdala Buckley." Japp reports that no one matching the Crofts' description is known in Melbourne and that Lazarus's art dealership is in financial difficulty. Upon returning to St. Loo, Poirot learns Nick has been poisoned by cocaine in a box of chocolates bearing a forged card reading "With the Compliments of Hercule Poirot." Nick survived because she ate only one.
Poirot arranges for the world to believe Nick has died, maintaining the deception for 24 hours. He reasons that the murderer, believing the victim dead, will be forced to act on the inheritance. The ruse works: Vyse telephones to say the missing will has arrived in the morning post. Poirot stages a gathering at End House. Vyse reads the will aloud, and to general astonishment it leaves everything to Mildred Croft. Poirot suggests a séance. The lights go out, and a white figure appears: Nick, alive, playing her own ghost. Japp identifies Mrs. Croft as Milly Merton, a notorious forger. The Crofts suppressed Nick's real will and substituted their forgery.
Nick declares her real will leaves End House to Charles and everything else to Frederica. Shots ring out through the window. Frederica is grazed, and a man outside collapses, dying: Frederica's estranged husband, a violent man with a drug addiction who had been stalking her. Nick asks Poirot to close the matter.
Poirot refuses. He announces there is a person "K" overlooked from his list: Nick herself. Japp testifies that he watched Nick retrieve the Mauser pistol from a secret panel and plant it in Frederica's coat to frame her. Poirot explains the full truth: Nick has never been engaged to Seton. It is Maggie, whose real name is also Magdala Buckley, who is Seton's fiancée. Nick learns of the engagement from Maggie's confidences, then devises a scheme to kill her cousin, assume the fiancée's identity, and inherit the Seton millions. She invents the "accidents" and recruits Poirot as an unwitting witness, ensuring Maggie's death looks like mistaken identity. The poisoned chocolates are self-administered with a controlled dose of cocaine. The key clue is Maggie's letter home, mentioning Nick had telegraphed her to come early, contradicting Nick's claim that inviting Maggie was Poirot's idea.
Poirot also exposes Challenger as a drug trafficker who conceals cocaine in specially designed wristwatches, the same kind both Frederica and Nick wear. Challenger flees. Nick calmly asks Frederica for her wristwatch "as a souvenir," and Poirot implies to Hastings that Nick intends to use the hidden cocaine to take a fatal dose, avoiding execution. Frederica and Lazarus plan to marry. Lazarus reveals that his earlier offer of 50 pounds for a portrait worth only 20 was a dealer's ploy to discourage outside valuations, allowing him to later acquire cheaply another painting worth at least 5,000 pounds. Poirot gazes at the portrait of old Sir Nicholas and declares with satisfaction that now he knows everything.