At the White House, brainwashed teleporting mutant Nightcrawler attacks the President of the United States. He is shot and retreats. Meanwhile, Logan explores an abandoned military installation at Alkali Lake in Alberta for clues to his past, but finds nothing. Jean Grey has been having premonitions and struggles to concentrate as her powers become increasingly difficult to control. Later, Logan 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 Logan, Rogue, Iceman, and Pyro escape, and Stryker's assistant Yuriko Oyama captures Cyclops and Xavier. During the attack, Logan confronts Stryker, who addresses him as Wolverine 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. Logan, Rogue, Iceman, and Pyro visit Iceman's parents and brother 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. Logan finds Stryker in an adamantium smelting lab and remembers it as where he received his adamantium skeleton. Logan 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 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 Logan remember Jean, and Xavier begins to hold a class. Meanwhile, a Phoenix-like shape rises from the flooded Alkali Lake.
Patrick Stewart as Professor Charles Xavier: A powerful telepathic mutant confined to a wheelchair who founded a School for "Gifted Youngsters", Xavier is a pacifist who believes humans and mutants can live together in harmony. He uses the Cerebro device, designed by Magneto and himself, to track and locate mutants across the world. A natural genius, Xavier is regarded as an authority on genetic mutation.
Hugh Jackman as Logan / Wolverine: A mysterious mutant who suffers from amnesia and has little to no recollection of his past life before he was grafted with an indestructible adamantium skeleton. Wolverine is a gruff loner, but is in love with Jean Grey and acts as a father figure to Rogue. He wields three highly durable adamantium blades that come out of each of his fists, has keen animal-like senses, the ability to heal rapidly from virtually any injury, and is a ruthless and aggressive fighter.
Ian McKellen as Erik Lehnsherr / Magneto: Once Xavier's ally, Magneto now believes mutants are superior to humans and that a genetic war is coming. Magneto wields the ability to manipulate metal magnetically, as well as the power to create magnetic fields and fly. He wears a helmet that renders him immune to Xavier's powers and all related telepathic powers. Imprisoned after his scheme in the first film, he is drugged by William Stryker for information over Cerebro and the Xavier Institute, before making his escape and forming an alliance with the X-Men to stop Stryker. He has demonstrated sophisticated knowledge in matters of genetic manipulation and engineering. The character's helmet was slightly redesigned as McKellen found wearing it uncomfortable in X-Men.
Halle Berry as Ororo Munroe / Storm: An African mutant and teacher at Xavier's School who can control the weather with her mind. Storm befriends Nightcrawler. Berry dropped out of Jennifer Lopez's role in Gigli to reprise the role.
Famke Janssen as Jean Grey: A teacher at Xavier's school and the X-Mansion's doctor, Jean has begun to experience a growth in her telepathy and telekinetic powers since the X-Men's battle with Magneto. She is Cyclops' fiancé, even though she is attracted to Wolverine.
James Marsden as Scott Summers / Cyclops: The field leader of the X-Men, and a teacher at Xavier's Institute, he shoots uncontrollable beams of concussive force from his eyes and wears a visor to control them. He is engaged to Jean. Cyclops is taken prisoner and brainwashed by Stryker.
Anna Paquin as Marie D’Ancanto / Rogue: A girl who can absorb any person's memories and abilities by touching them. As she cannot control this power, Rogue can easily kill anyone and thus is unable to be close to people.
Rebecca Romijn-Stamos as Raven Darkholme / Mystique: Magneto's shapeshifting henchwoman, Mystique is blue, covered in scales, and acts as a spy. She injects a prison guard with metal, with which Magneto makes his escape, and also sexually tempts Wolverine. Romijn's makeup previously took nine hours to apply during the filming of X-Men, but the make-up department was able to bring it down to six hours for X2.
Brian Cox as Colonel William Stryker: A military scientist who plans a worldwide genocide of mutants using Xavier and Cerebro. Stryker has experimented on mutants in the past, including Wolverine, and uses a serum to control them. Singer opted to cast Cox in the role as he was a fan of his performance as Hannibal Lecter in Manhunter.
Alan Cumming as Kurt Wagner / Nightcrawler: A kindly German mutant with a strong Catholic faith, yet ironically he has the appearance of a blue demon. Nightcrawler was used by Stryker in an assassination attempt on the President of the United States and gives help to the X-Men. He is capable of teleporting himself (and others) instantly from one location to another. On his body are many tattoos, one for every sin. Cumming had always been Singer's choice for the role, but Cumming could not accept the part due to scheduling conflicts. Ethan Embry had been reported to be in contention for the role, but the film labored in development long enough for Cumming to accept the part. Singer also felt comfortable in casting Cumming since he is fluent in German. The drawings of Adam Kubert were used as inspiration for Nightcrawler's makeup design, which took four hours to apply. For the scene where Nightcrawler has his shirt off, Cumming went through nine hours. To best pose as Nightcrawler, Cumming studied comic books and illustrations of the character.
Bruce Davison as Senator Robert Kelly: Although Kelly was killed in the first film, Davison reprised the role for scenes where Mystique uses his persona to infiltrate the government.
Shawn Ashmore as Bobby Drake / Iceman: Rogue's boyfriend, he can freeze objects and create ice. His family is unaware that he is a mutant and simply believe he is at a boarding school. After returning home, Bobby reveals to them what he actually is, much to his brother's derision.
Aaron Stanford as John Allerdyce / Pyro: A friend of Bobby and Rogue, Pyro has anti-social tendencies and has the ability to control (although not create) fire. The filmmakers cast Stanford in the role after they were impressed with his performance in Tadpole.
Kelly Hu as Yuriko Oyama / Deathstrike: A female mutant who has a healing ability like Wolverine's and is controlled by Stryker. She wields long adamantium fingernails. Only her first name is mentioned in dialogue.
Additionally, Daniel Cudmore portrayed Peter Rasputin / Colossus: a mutant with the ability to turn his body into metal, the character's importance was reduced to a cameo, Michael Reid MacKay portrayed Jason 143, William Stryker's son who had the ability to create illusions. Keely Purvis portrayed the little girl whom Jason used as an avatar when controlling Xavier. Cotter Smith portrayed US President McKenna. Cameo appearances include Katie Stuart as Kitty Pryde, Bryce Hodgson as Artie, Kea Wong as Jubilation Lee / Jubilee, Steve Bacic as Dr. Hank McCoy and Shauna Kain as Theresa Rourke / Siryn. Gambit's cameo was shot, but the footage was not used in the final cut. Also in the final scene with Xavier, a girl is seen dressed in a Native American style jacket, as well as a blond haired boy dressed in blue, played by Layke Anderson. These were confirmed to be Danielle Moonstar and Douglas Ramsey. Michael Dougherty and Dan Harris, the film's writers, cameo in scenes of Wolverine's Weapon X flashbacks as surgeons
also marketed as X2: X-Men United
based on the X-Men superhero team appearing in Marvel Comics. It is the sequel to the first film: X-Men (2000), as well as the second installment in the 20th Century Fox X-Men film series