On a train, wealthy, neurotic Bruno Antony recognizes tennis player Guy Haines and strikes up a conversation. While using Guy's cigarette lighter, Bruno notices it is inscribed "From A to G," and guesses that "A" is Senator Morton's daughter Anne, whom Guy intends to marry after Miriam, his current wife, divorces him. Over lunch in his compartment, Bruno describes to Guy his hatred of his father, and suggests a plan for a perfect murder. He proposes that two strangers, who each want someone in their life killed, swap murders. In that way, each has murdered a perfect stranger and is unlikely to be apprehended. For example, Bruno says, he could kill Miriam, and Guy would then return the favor by killing Bruno's father. Believing Bruno to be a harmless crank, Guy agrees that the theory is viable and disembarks from the train at his home town of Metcalf, unaware that he has left his distinctive lighter in Bruno's compartment. In Metcalf, Guy proceeds to the music store where Miriam works. There, Miriam tells him that although she is pregnant with another man's baby, she has no intention of divorcing him. In full sight of the other employees, a furious Guy brutally shakes her, then calls Anne and, still angry, shrieks that he would like to strangle his wife. Meanwhile, Bruno, at his parents' home, overhears his father threaten to institutionalize him, and decides to put his plan into action immediately. Traveling to Metcalf one night, he follows Miriam and two boyfriends to an amusement park tunnel-of-love ride and strangles her on a nearby island. While Bruno is murdering Miriam, Guy is on the train to Washington, D.C. The only other passenger in his car is extremely drunk, but tells Guy his name is Prof. Collins. Later, outside of his residence, Guy encounters Bruno, who informs him of Miriam's murder and shows him her eyeglasses as proof of the deed. When a stunned Guy insists that he will turn Bruno over to the police, Bruno convinces him that the police will believe that he was involved and makes it clear that he expects Guy to complete his part of the "bargain." Guy flees from Bruno and is soon summoned by phone to Senator Morton's home, where Morton informs him of Miriam's death. Although Guy hopes that Collins will give him an alibi, Collins reports having no memory of his drunken evening. The police release Guy, but assign Hennessey, a police detective, to keep a constant watch on him. Although Guy tries to evade Bruno, Bruno sends Guy a map of his father's bedroom, a key to the house and a gun. When Guy continues to ignore him, Bruno manages to ingratiate himself with Guy's friends. Anne, who has become increasingly disturbed by Guy's strange behavior, then confronts him. Under her questioning, he admits that Bruno killed Miriam and tells her about their encounter on the train. A desperate Guy then telephones Bruno and tells him that he will kill his father that night. He evades the detective and uses the key to enter the Antony house, intending to beg Antony to get help for Bruno. However, Bruno, suspecting Guy's motives, is waiting for him in his father's room. The following day, Anne tries to enlist the help of Bruno's doting, dotty mother, who insists that Bruno must be playing a practical joke. Before a tearful Anne leaves, Bruno informs her that Guy killed Miriam and offers as proof Guy's request that Bruno retrieve the lighter that he dropped at the scene of the crime. When Anne reports this to Guy, he realizes that Bruno intends to use his lighter to frame him for the murder. Guy is scheduled to play in a tennis tournament in Washington, D.C., but believing that Bruno will plant the lighter after dark, decides not to drop out. In order to reach Metcalf before Bruno, however, Guy must win the tournament in three sets. He wins the first two sets easily, but loses the third. Meanwhile, Bruno arrives in Metcalf and accidentally drops the lighter down a storm drain. While Bruno attempts to retrieve the lighter, Guy continues to play a determined game. After recovering the lighter, Bruno proceeds to the amusement park. Guy wins the final match, and while Barbara distracts Hennessey and his partner Hammond, Guy takes a waiting cab to the train. In Metcalf, the police, alerted by Hennessey, stake out the park. When the sun sets, Bruno joins the long line of people waiting for the tunnel-of-love boat to the island, but is recognized by the ride's operator. Guy arrives just as the man points out Bruno to the police, and the police mistakenly believe that the operator has identified Guy as the killer. Bruno bolts from the line, chased by Guy, and heads for the carousel. The police shoot at the running men and accidentally hit the operator, who falls on the controls and sets the ride spinning wildly. While Bruno and Guy struggle under the plunging hooves of the carousel horses, a volunteer pulls the controls, and the carousel crashes to a stop, breaking down completely. Bruno, who has been pinned beneath the carousel, refuses to clear Guy, but as he dies, his hand opens, revealing Guy's lighter. After the tunnel-of-love proprietor explains that it was Bruno he saw on the night of the murder, Guy tells Anne that he has been cleared.