At a German concentration camp in occupied Poland in 1944, scientist Dr. Schmidt observes young Erik Lensherr bend a metal gate with his mind when the child is separated from his parents. In his office, Schmidt orders Lensherr to similarly move a coin on a desk, and kills his mother when the child cannot. In his grief and anger, Lensherr's magnetic power manifests, killing two guards and destroying the room, to Schmidt's delight. At a mansion in Westchester County, New York, young telepath Charles Xavier meets homeless young shape-shifter Raven. Overjoyed to meet someone else "different" like him, he invites her to live with his family.
In 1962, an adult Lensherr is tracking down Schmidt to take revenge. In England, Oxford University graduate Xavier is publishing his thesis on mutation; Raven, now his foster sister, lives with him. In Las Vegas, CIA agent Moira MacTaggert follows US Army Colonel Hendry into the Hellfire Club, where she sees Sebastian Shaw, Emma Frost, and Azazel. After Shaw threatens Hendry, Azazel disappears with the officer; moments later Hendry is in the War Room, advocating that the US install nuclear missiles in Turkey.
Shaw later kills Hendry, revealing himself as Schmidt and demonstrating the energy-absorbing mutant power that has de-aged him.
MacTaggert, seeking Xavier's advice on mutation, convinces him and Raven to join her at the CIA, where they convince Director McCone that mutants exist and Shaw is a threat. The unnamed "Man in Black Suit", another CIA executive, sponsors the mutants and invites them to the CIA's secret "Division X" facility. Xavier locates Shaw, arriving in time to stop Lensherr, who had attacked Shaw, from drowning as Shaw escapes. Xavier brings Lensherr to Division X, where they meet young scientist Hank McCoy, a prehensile-footed mutant whom Xavier inadvertently outs as a mutant. McCoy, developing a bond with Raven, promises her he will find a way to normalize their appearance. Xavier uses a mutant-locating device, Cerebro, to find and recruit mutants for training to stop Shaw. He and Lensherr find stripper Angel Salvadore; taxi driver Armando Muñoz, who takes the code name Darwin; Army prisoner Alex Summers, who calls himself Havok; and Sean Cassidy, who dubs himself Banshee. Raven takes the name Mystique. She also dubs Charles "Prof. X" and Erik "Magneto."
When Frost meets with a Soviet general in the USSR, Xavier and Lensherr capture her. Meanwhile, Azazel, Riptide and Shaw attack Division X, killing everyone but the young mutants and offering them the chance to join him. Angel accepts; when Darwin tries to fight back, Shaw kills him. With the facility destroyed, Xavier takes the mutants to train at his family mansion. McCoy devises protective uniforms and a stealth jet. In Moscow, Shaw compels the general to have the Soviet Union install nuclear missiles in Cuba.
During the Cuban Missile Crisis, US President John F. Kennedy institutes a blockade to stop a Soviet freighter from moving the nuclear missiles to Cuba. Shaw, wearing a helmet that foils Xavier's telepathy, accompanies the Soviet fleet to ensure the missiles arrive, trying to trigger World War III and achieve mutant ascendency. Raven goes to seduce Lensherr, who convinces her to embrace her nature as a mutant. Later, McCoy offers Raven his cure for her appearance, but she refuses. The cure backfires on McCoy, rendering him a leonine beast. Though ashamed of his new appearance, he pilots the mutants and MacTaggert to the blockade line. In an ensuing battle with Shaw, Lensherr takes the helmet for himself, allowing Xavier to immobilize Shaw. Despite Xavier's objections, Lensherr kills Shaw by forcing the Nazi coin through his brain.
Fearing the mutants, the fleets fire their missiles at them. In a struggle, Xavier keeps Lensherr from destroying the fleets with the missiles, but when MacTaggert fires at Lensherr, a deflected bullet hits Xavier in the spine. Lensherr, remorseful, leaves with Mystique, Angel, Riptide and Azazel. A wheelchair-bound Xavier and the mutants return to the mansion, where he intends to open a school. MacTaggert promises never to reveal his location and they kiss; at the CIA later, she says she has no clear memory of recent events. Lensherr, in a uniform with the helmet and calling himself Magneto, breaks Frost from confinement.