At the White House, brainwashed teleporting mutant Nightcrawler attempts to assassinate the President of the United States but before he can do so, is shot and retreats. Meanwhile, Wolverine explores an abandoned military installation at Alkali Lake in Alberta for clues to his past, but finds nothing. Jean has been having premonitions and struggles to concentrate as her powers become increasingly difficult to control. Later, Wolverine returns to Professor Xavier’s school for mutants, and Xavier tracks Nightcrawler using Cerebro. Xavier and Cyclops go to question the imprisoned Magneto about the attack, while X-Men Storm and Jean Grey retrieve Nightcrawler. Military scientist Colonel William Stryker approaches the president and receives approval to investigate Xavier’s mansion for their ties to mutants in the wake of the recent attack. Stryker’s forces invade the school and abduct some of the students. Colossus leads the remaining students to safety while Wolverine, Rogue, Iceman, and Pyro escape, and Stryker’s assistant Yuriko Oyama captures Cyclops and Xavier. During the attack Wolverine confronts Stryker, who addresses him by name and seems to know about his past.
The shape-shifting Mystique gains information about Magneto’s prison and helps him escape while also discovering schematics for a second Cerebro. Wolverine, Rogue, Iceman, and Pyro visit Iceman’s parents in Boston and meet up with Storm, Jean, and Nightcrawler. The X-Jet is attacked by fighter jets while flying back to the mansion and is shot down, but Magneto saves them from crashing. Magneto explains to the group that Stryker has built the second Cerebro to use it and Xavier to telepathically kill every mutant on the planet. Stryker’s son, Jason, is a mutant with mind-controlling powers, whom Stryker will use to force Xavier to do this. Stryker had also previously used Jason’s powers to orchestrate Nightcrawler’s attack as a pretense to gain approval to invade Xavier’s mansion. Magneto also tells Wolverine that Stryker was the man who grafted his adamantium skeleton onto his bones and is responsible for his amnesia. Jean reads Nightcrawler’s mind and determines that Stryker’s base is underground in a dam at Alkali Lake.
Disguised as Logan, Mystique infiltrates Stryker’s base. She lets the rest of the mutants in and Magneto and Mystique go to disable Cerebro before the brainwashed Xavier can activate it. Storm and Nightcrawler rescue the captured students, and Jean fights a mind-controlled Cyclops; their battle frees Cyclops but damages the dam, which begins to rupture. Wolverine finds Stryker in an adamantium smelting lab and remembers it as where he received his adamantium skeleton. Wolverine fights and kills Yuriko, then chases Stryker to a helicopter pad and chains him to the helicopter’s wheel. Magneto stops Cerebro and, using Mystique impersonating Stryker to command Jason, has Xavier redirect its powers on normal humans. The two subsequently use Stryker’s helicopter to escape, accompanied by Pyro who has been swayed to Magneto’s views. Nightcrawler teleports Storm inside Cerebro, where she creates a snowstorm to break Jason’s concentration and free Xavier from his control.
The X-Men flee the dam as water engulfs it, killing Stryker, but the X-Jet loses all power and struggles to take flight as the flood water rushes towards them. Jean sneaks off the jet and telepathically wishes the team goodbye. She holds back the water and raises the jet above it as flames erupt from her body, until she lets go and allows the flood to crash down upon her, presumably killing her. The X-Men give the president Stryker’s files, and Xavier warns him that humans and mutants must work together to build peace. Back at the school, Xavier, Cyclops, and Wolverine remember Jean, and Xavier begins to hold a class. Meanwhile, a Phoenix-like shape rises from the flooded Alkali Lake.