During the Korean War, the Soviets and Chinese capture a U.S. Army platoon and take it to Manchuria in communist China. Three days later, Staff Sergeant Raymond Shaw (Laurence Harvey) and Captain Bennett Marco (Frank Sinatra) manage to return to UN lines. Upon Marco’s recommendation, Shaw is awarded the Medal of Honor for saving their lives in combat. Shaw returns to the United States to a hero’s welcome where he is exploited by his mother, Mrs. Eleanor Iselin (Angela Lansbury), on behalf of the political career of her husband and Shaw’s stepfather, United States Senator John Yerkes Iselin (James Gregory). When asked to describe him, Marco and the other soldiers automatically respond, “Raymond Shaw is the kindest, bravest, warmest, most wonderful human being I’ve ever known in my life,” even though Shaw is a cold, sad, unsympathetic loner.
In the years to follow, Marco, who has since been promoted to major and assigned to Army Intelligence, suffers from a recurring nightmare. In it, a hypnotized Shaw blithely and brutally murders the two missing soldiers before an assembly of military leaders from the communist nations, during a practical demonstration of a revolutionary brainwashing technique. Marco is compelled to investigate, but with no solid evidence to back his claims fails to receive support from his uplines. However, Marco learns that another soldier from the platoon, Allen Melvin (James Edwards), has had the same nightmare. When Melvin and Marco separately identify the identical two men from their dreams as leading figures in communist governments, Army Intelligence agrees to help Marco investigate.
Meanwhile, Eleanor drives the ascension of Iselin, a McCarthy-like demagogue stirring domestic turmoil and climbing the political ladder based on claims that varying numbers of communists work within the Department of Defense. Shaw, who broke with the couple immediately upon his return to America, is gradually revealed to have had been programmed by Russian and Chinese communists to be a sleeper agent who will blindly obey orders without any memory of his actions. His heroism was a false memory implanted in the platoon during their brainwashing in Manchuria. His programming is triggered by seeing the Queen of Diamonds card while playing solitaire after being induced by his handlers.
Several years pass before Shaw finds happiness when he rekindles a youthful romance with Jocelyn Jordan (Leslie Parrish), the daughter of liberal Senator Thomas Jordan (John McGiver), one of his stepfather’s political rivals. Mrs. Iselin had previously broken up the relationship, but now facilitates the couple’s reunion in order to garner Jordan’s support for Iselin’s bid for the Vice Presidency. Although pleased with the match, Jordan makes it clear that he will block any effort of Iselin’s to seek their party’s nomination. Jocelyn, wearing a Queen of Diamonds costume at a party for her thrown by the Iselins, inadvertently triggers Shaw’s programming and elopes with him. In response to the senator’s rebuff, Mrs. Iselin, who is revealed to be Shaw’s American handler, triggers him to kill Jordan at his home, shooting Jocelyn as well when she happens upon the scene. Afterwards, Shaw has no knowledge of his actions and is grief-stricken when he learns of the murders.
Eventually discovering the card’s role in Shaw’s conditioning, Marco uses a forced deck in an attempt to deprogram him and reveal his next assignment, which appears imminent. Mrs. Iselin primes her son to assassinate their party’s presidential nominee at the height of the ongoing political convention so that Senator Iselin, as the vice-presidential candidate, will become the nominee by default. In the uproar, he will immediately seek emergency powers that when elected will, in Mrs. Iselin’s words, “make martial law seem like anarchy”. Mrs. Iselin tells Shaw that while she had requested a programmed assassin for the task, she never knew it would be her own son, who was selected by the communists in order to bind her more closely to their cause. Kissing Shaw on the lips, she vows that once in power she will exact revenge for her son’s selection as an assassin.
Shaw enters the convention hall disguised as a priest and takes up a sniper’s position high in its farthest reaches. Alarmed by Shaw’s failure to call by the appointed time, Marco and his supervisor, Colonel Milt (Douglas Henderson), race to the hall to find and stop him. When the moment to shoot comes, Shaw instead kills his mother and Senator Iselin. When Marco arrives an instant later, Shaw tells him he failed to call to prevent anyone from interfering with his change in plans. Shaw then fatally turns the rifle on himself.