In 1944, in a Nazi death camp, Nazi scientist Klaus Schmidt witnesses young prisoner Erik Lehnsherr bending a metal gate with his mind when he is separated from his parents. In his office, Schmidt orders Lehnsherr to move a coin on his desk, and kills the boy’s mother when Lehnsherr fails to do so. In grief and rage, Lehnsherr’s magnetic power manifests, killing the two guards while they scream in pain and destroying the room. Meanwhile, in a mansion in Westchester County, New York, child telepath Charles Xavier meets young shapeshifter Raven, whose natural form is blue-skinned and scaly. Overjoyed to meet someone “different”, like himself, he invites her to live with his family as his foster sister.
In 1962, Lehnsherr, now a Nazi hunter, is tracking down Schmidt for vengeance, while Xavier graduates from the University of Oxford. In Las Vegas, CIA officer Moira MacTaggert follows U.S. Army Colonel Hendry into the Hellfire Club, where she sees Schmidt—now known as Sebastian Shaw— with mutant telepath Emma Frost, teleporter Azazel, and cyclone-producing Riptide. Threatened by Shaw and teleported by Azazel to the Joint War Room, Hendry advocates deployment of nuclear missiles in Turkey. Shaw, an energy-absorbing mutant whose powers have de-aged him, later kills Hendry by releasing the energy he absorbed previously from an exploding grenade.
MacTaggert, seeking Xavier’s advice on mutation, takes him and Raven to the CIA, where they convince Director McCone that mutants exist and Shaw is a threat. Another CIA officer sponsors the mutants and invites them to the secret “Division X” facility. MacTaggert and Xavier find Shaw as Lehnsherr is attacking him on his yacht, and rescue Lehnsherr from drowning, while Shaw escapes in a submarine. Xavier brings Lehnsherr to Division X, where they meet young scientist Hank McCoy, a mutant with prehensile feet, who believes Raven’s DNA may provide a “cure” for their appearance. Xavier uses McCoy’s mutant-locating device Cerebro to seek recruits against Shaw. Xavier and Lehnsherr recruit stripper Angel Salvadore, cabbie Armando Muñoz, Army prisoner Alex Summers, and conceited runaway Sean Cassidy.
When Frost meets with a Soviet general in the USSR, and uses her telepathic powers to pretend to have sex with him, Xavier and Lehnsherr capture Frost and discover that Shaw intends to start a nuclear war between the US and the USSR which would accelerate, trigger global mutations and therefore lead to extinction of the human race. Azazel, Riptide and Shaw attack Division X, killing everyone but the mutants, whom Shaw invites to join him. Salvadore accepts; and when Summers and Muñoz retaliate, Shaw kills Muñoz. In Moscow, Shaw compels the general to have the USSR install missiles in Cuba. Wearing a helmet that blocks telepathy, Shaw follows the Soviet fleet in a submarine to ensure the missiles break a US blockade.
Raven, thinking McCoy is attracted to her in her natural form, tells him not to use the cure. When she later attempts to seduce Lehnsherr by taking the forms of various women, Lehnsherr tells her she is beautiful as she is, in her natural mutant form which makes her contemplate naturism. McCoy uses the cure on himself but it backfires, giving him blue fur and leonine aspects. With McCoy piloting, the mutants and MacTaggert take a jet to the blockade line, where Xavier uses his telepathy to influence a Soviet sailor to destroy the ship carrying the missiles, and Lehnsherr uses his magnetic power to lift Shaw’s submarine from the water and deposit it on land. During the ensuing battle, Lehnsherr seizes Shaw’s helmet, allowing Xavier to immobilize Shaw. Lehnsherr tells Shaw he shares Shaw’s exclusivist view of mutants but, to avenge his mother, kills Shaw—over Xavier’s objections—by forcing the Nazi coin from his childhood through Shaw’s brain, causing massive pain to Xavier in the process.
Fearing the mutants, both fleets fire missiles at them, which Lehnsherr turns back in mid-flight. MacTaggert tries to stop Lehnsherr by shooting him but he deflects the bullets, one of which hits Xavier in the spine. Lehnsherr rushes to help Xavier and, distracted, allows the missiles to fall harmlessly into the ocean. Parting with Xavier over their differing views on the relationship between mutants and humans, Lehnsherr leaves with Azazel, Riptide, Salvadore, and Mystique. Later, Xavier – now using a wheelchair – and his mutants are at the X-Mansion, where he intends to open a school. MacTaggert promises never to reveal his location and they kiss. When they kiss, Xavier uses his powers and erases their memories from her mind. Elsewhere, Lehnsherr, now wearing Shaw’s helmet, frees Frost from confinement alongside Raven and introduces himself as “Magneto”.