In 1944, at the Auschwitz concentration camp, Nazi officer Klaus Schmidt witnesses young prisoner Erik Lehnsherr bend a metal gate with his mind upon being separated from his mother. In his office, Schmidt orders Erik to move a coin on his desk, and kills his mother when Erik can't. In grief and anger, Erik's magnetic power manifests, killing two guards and destroying the room. Separately, at 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.

Eighteen years later, in 1962, Erik is tracking down Schmidt to avenge his mother, while Xavier earns his doctorate from the University of Oxford as Professor of Genetics. In Las Vegas, CIA officer Moira MacTaggert follows U.S. Army Colonel Hendry into the Hellfire Club, where she sees Schmidt (now called Sebastian Shaw) with mutant telepath Emma Frost, cyclone-producing Riptide, and teleporter Azazel. Threatened by Shaw and teleported to the Joint War Room, Hendry advocates deploying nuclear missiles in Turkey. Shaw, an energy-absorbing mutant whose powers have kept him young, later kills Hendry.

Moira, 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. Moira and Xavier find Shaw as Erik is attacking him, and Xavier rescues Erik from drowning. Shaw escapes. Xavier brings Erik 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 Erik recruit stripper Angel Salvadore, cabbie Armando Muñoz, Army prisoner Alex Summers, and drifter Sean Cassidy. They create nicknames, Raven dubbing herself "Mystique".

When Frost meets with a Soviet general in the USSR, and uses her telepathic powers to manipulate him, Xavier and Erik capture her and discover Shaw intends to start World War III, triggering mutant ascendency. Azazel, Riptide and Shaw attack Division X, killing everyone but the mutants, whom Shaw invites to join him. Salvadore accepts; when Alex 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. In the meantime, Xavier takes the remaining recruits back to his mansion where they focus on harnessing their abilities. McCoy manages to get a cure ready, but Raven, after being persuaded by Erik, decides she doesn't want to hide her identity and refuses the cure. McCoy uses the cure on himself but it backfires, giving him blue fur and leonine aspects.

With McCoy piloting, the mutants and Moira 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 Erik uses his magnetic power to lift Shaw's submarine from the water and deposit it on land. During the ensuing battle, Erik seizes Shaw's helmet, allowing Xavier to immobilize Shaw. While Shaw is helpless, Erik reveals he shares Shaw's exclusivist view of mutants but, to avenge his mother, uses his power to kill Shaw by slowly pushing a Nazi coin through Shaw's brain, killing him. Unable to risk releasing Shaw, Xavier begs Erik to stop, but is forced to experience the pain of Shaw's death.

Both fleets fire missiles at the mutants, which Erik turns back in mid-flight. Moira tries to stop Erik by shooting him but he deflects the bullets, one of which hits Xavier in the spine. Erik 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, Erik leaves with Salvadore, Azazel, Riptide and Mystique. Later, a wheelchair-using Xavier and his mutants are at the mansion, where he intends to open a school. Moira promises Xavier never to reveal his location, but Xavier makes sure of this by wiping her memories. Meanwhile, Erik, along with Mystique and the other Hellfire Club members, frees Frost from confinement and dubs himself "Magneto".