It is the year 2023. New York City is a desolate wasteland. An army of robots called the Sentinels have targeted mutants and the humans that helped them. A young blonde mutant is seen walking through the area. He brushes off some dirt on the ground and sees something with the Mutant Academy's X on it. A flash is seen, which catches the mutant off guard, and he is presumably killed.
In Moscow, several pods carrying the Sentinels drop the robots down near the area. The mutants Blink (Fan Bingbing) and Warpath (Booboo Stewart) spot them. Using her powers, Blink opens portals to transport herself and Warpath to the lower level to warn fellow mutants Colossus (Daniel Cudmore) and Sunspot (Adan Canto) about the Sentinels' arrival. Kitty Pryde (Ellen Page) runs with Bishop (Omar Sy) as she phases them through walls so that the others can fight. Bobby Drake/Iceman (Shawn Ashmore) arrives to join the fight. Colossus utilizes his steel powers, as does Sunspot with his fire powers, to combat the Sentinels. Kitty takes Bishop into a vault and starts to create a link with his consciousness. The Sentinels latch onto the mutants and adapt to their powers, so they are able to copy Colossus, Sunspot, and Iceman to use their powers against them and kill them all, along with Blink and Warpath. A Sentinel breaks into the vault and nearly kills Kitty and Bishop, but they are saved at the last second when they are transported out of there.
In China, an X-jet descends, carrying Professor Charles Xavier (Patrick Stewart), Ororo Munroe/Storm (Halle Berry), Logan/Wolverine (Hugh Jackman), and Erik Lensherr/Magneto (Ian McKellen), bringing them to a monastery to meet with the Kitty, Iceman, and the other mutants, all alive. Kitty explains that she creates a link with Bishop's consciousness to send it to his younger self days earlier so that he may warn the other mutants about the arrival of the Sentinels. Xavier wants to use this power to go back to 1973 to prevent the Sentinels from being created. This was a result of a project formed by a scientist named Bolivar Trask (Peter Dinklage). He began to perform experiments on mutants, using samples of their DNA. This caught the attention of Raven Darkholme/Mystique (Jennifer Lawrence), who found him at a summit in Paris and murdered him. After she was captured, this influenced the government to go ahead with the Sentinel project, using Mystique's DNA to give the Sentinels the ability to adapt to the mutants' powers. Since Wolverine is the only one who can easily regenerate in both the past and present, he volunteers to go back to stop Mystique from killing Trask. Before this task is carried out, both Xavier and Magneto tell Wolverine to find the younger versions of both of them. Magneto warns him that in his past, he led himself and Mystique down a dark path.
Kitty forms the link to Wolverine's consciousness. He wakes up in 1973 next to a lava lamp in a waterbed next to a woman. He finds himself naked and stares out the window to NYC in the 70's, to his surprise. Three men barge into the room and tell Wolverine he's supposed to be watching the boss's daughter, not screwing her. Wolverine quips that he's from the future, then sprouts his claws, which are bone, as opposed to adamantium. The men shoot him, but he pushes the bullets out and heals, then kills all three men and takes the car keys off one of them.
In Washington, DC, Trask is meeting with Congress to lobby his Sentinel program. Senator Brickman (Michael Lerner) argues that it would be pointless to target the mutants since they only represent about a tenth of the population. The decision is made to go against the project, to Trask's displeasure.
Wolverine arrives at the X-Mansion, which is nearly vacant. Greeting him at the door is Hank McCoy/Beast (Nicholas Hoult). Wolverine asks for the professor, but Hank turns him away. Wolverine pushes his way in and then punches Hank in the face, assuring him that where he comes from, they are good friends. Angry, Hank turns into his Beast form and attacks Wolverine, throwing him down the stairs and fighting with him. The young Charles Xavier (James McAvoy) comes down the stairs, and he is walking, to Wolverine's surprise. He tells Xavier that he was sent from the future by his old self to aid him, along with Magneto, on a mission to stop Raven from killing Trask, but Xavier refuses to help, citing Erik as a murderer, and throwing Wolverine's "fuck off" comment at him from the time that he and Erik sought him out (during a scene in "First Class"). When asked how Xavier can walk, Hank (no longer Beast) explains that he developed a serum to allow Xavier to walk, but because he has taken too much of it, it has lost him his telepathic powers. The strain of losing Erik and Raven, along with his students that were drafted to the Vietnam War, which eventually shut the school down, took a massive toll on Xavier's heart and soul. After reconsidering, however, Xavier decides to help. He tells Wolverine that Erik is locked up in a maximum security cell in the Pentagon for allegedly assassinating JFK by curving the bullet that struck him. Wolverine says he knows someone who can help. Without Xavier's powers to use Cerebro to locate him, Hank suggests using a phone book.
In Saigon, Colonel Sanders (Andreas Apergis) meets with Major William Stryker (Josh Helman) at a camp where they enter a tent filled with other mutant GI's, including Alex Summers/Havok (Lucas Till), Toad (Evan Jonegkeit), Ink (Gregg Lowe), and another unnamed mutant. They are to be transported to Trask Industries, but Sanders turns out to be Mystique in disguise. She and the other mutants take out the soldiers and incapacitate Stryker. Havok asks her about Erik, but she tells him she works alone now. Reverting to the Colonel's disguise, Mystique leads them on a jet to be taken out of there.
Wolverine, Xavier, and Hank arrive at the home of Peter Maximoff/Quicksilver (Evan Peters), a mutant with superhuman speed. Although he is a bit of a trickster, he agrees to join the three mutants in their task once Wolverine reveals his claws.
Mystique infiltrates Trask Industries under the guise of Trask himself. She goes into his office and gains access to his personal files, including blueprints for the Sentinels, as well as autopsy reports on the mutants he's experimented on. She finds gruesome pictures of her former comrades, such as Azazel and Angel Salvadore. She sheds a tear for them as Trask's secretary comes in. She turns back into Trask as the secretary hands her something.
Wolverine, Xavier, Hank, and Quicksilver sneak into the Pentagon. Quicksilver slips into an elevator and steals a guard's uniform after taping him in the elevator. The other three create distractions to send others out. Quicksilver slides a tray of food with the note "Mind The Glass" into Erik's cell. Using his powers, Quicksilver shatters the glass, allowing Erik to climb out of the cell. He holds onto Erik's neck to prevent him from getting whiplash as they slip back into the elevator. When Erik comes face-to-face with Xavier once again, the latter angrily punches him. Before they can all leave, they are cornered by six guards in the kitchen, all aiming guns at their faces. Xavier knows what Erik is thinking, and as he manipulates the metal objects in the room, Quicksilver casually slips on some music and runs through the whole kitchen, allowing him to move the bullets away from the fellow mutants, but not before he moves the guard's hands far enough to make them hurt themselves.
The mutants depart with Quicksilver as they board a jet and Xavier gives him the car to drive home. The tension is still hot between Xavier and Erik, as the former blames the latter for his inability to walk properly, as well as abandoning him. Erik fires back that Xavier abandoned them, as many of their former allies (he name-drops Angel, Azazel, Banshee, and Emma Frost) have since been killed by Trask. Erik's anger almost causes the jet to decompress and nearly crash into the ocean, but he cools off. Wolverine quips that he sees that Erik was always an asshole.
In Paris, Mystique is in a club where she finds the Vietnamese general drinking with his comrades and the Russian soldiers. He brings her to his room, expecting to have her seduce him, until she reveals her mutant form and holds her foot against the general's throat until he is unconscious. She picks up an invitation on the table to the summit in Paris.
On the jet, Xavier and Erik play chess. Erik tries to assure Xavier that he did not kill JFK, but was trying to save him, since he claims that JFK was one of them.
On the day of the summit, the mutants make their way into the building to find Mystique. Trask arrives with Stryker and his blueprints for the Sentinels. Trask is also carrying a device that detects the presence of mutants. It picks up a high reading level, pointing at the Vietnamese general. As the others close in on him, he turns into Mystique, who takes down every man in her path before grabbing a gun and aiming it at Trask. Wolverine, Xavier, Erik, and Hank arrive just in time to stop Mystique. Stryker shoots his taser gun at her, but Erik pulls the tasers off and throws it back into Stryker. As Xavier tries to hold Raven down, Erik realizes that everything can be prevented if he just kills Mystique. He grabs his gun and aims it at her, but she runs out the window. Erik fires a shot and manipulates the bullet to follow Mystique out the window, striking her in the leg. Wolverine recognizes Stryker as the man who filled him with the adamantium. The distress of seeing his old nemesis causes a tense rift in the future, where he sprouts his claws and slashes Kitty. Magneto orders the others to restrain Wolverine. This also causes a brief lapse in his memory, as he briefly doesn't recognize Xavier nor Hank as he turns into Beast to go after Mystique and Erik. Wolverine is calmed down and he regains his memory.
Outside, the people in the crowd see Mystique as she falls to the ground wounded. She turns into a regular bystander and tries to flee, but Erik can see her limping, and, with the bullet still in her leg, he is able to pull her toward him. He lifts the bullet out and nearly throws it into her head, until Beast attacks Erik and tackles him into a fountain. Erik manipulates the other metal items near him,, including cars, to bring them nearer to him, causing the crowd to flee, which allows Mystique to blend in and escape. Beast holds Erik underwater until he uses the metal birds in the fountain to grab Beast and pull him off Erik. Erik gets away while the remaining bystanders capture Beast on camera. He runs away, frightening everyone.
Following the near assassination, Trask, Stryker, and other officials meet in the White House as news reports of the mutants' sightings are shown on television. Trask convinces President Nixon (Mark Camacho) that someone like Mystique can easily impersonate a Secret Service agent or even the President himself and order a nuclear strike. Trask orders her to be found alive so that he can use her DNA for his experiment. Nixon allows for the Sentinel program to receive the proper funding. Trask's scientists find Mystique's blood on the street and take it as a sample.
Back at the mansion, Xavier starts to fall, losing his ability to walk again, but also regaining his telepathic powers. Hank retrieves the serum, but Xavier refuses to take it. He decides to access Cerebro to locate Mystique. However, he is too overwhelmed and unfocused, causing him to fail. Xavier feels he's lost the drive to go on with the fight, feeling as helpless as his students. Wolverine looks him down and says that at one point, it was he who was Xavier's most helpless student. He allows Xavier to look into his mind, where he sees Wolverine's memories of Stryker experimenting on him, as well as him having to kill Jean Grey (Famke Janssen). Xavier cries that he doesn't want Wolverine's suffering or his future. He goes in deeper and finds himself in Wolverine's position in the future. This allows him to come face-to-face with his older self. Old Xavier knows that Young Xavier is scared, but he encourages him to maintain the hope that has driven him all those years to find peace between humans and mutants. With this reassurance, Young Xavier gets back into Cerebro and locates Mystique at an airport. He communicates with her through the other people near her, trying to persuade her to not go through with her task. She ignores him, believing she is doing the right thing. Xavier, having spotted her ticket through another woman's mind, sees that Mystique is headed for Washington, DC.
Meanwhile, Erik has snuck into Trask Industries and gained access to blueprints for the Sentinels before hopping on the train that is carrying them. He manipulates the train tracks and inserts them into the Sentinels. As he makes it to DC, he infiltrates the Pentagon with two ball bearings to take out the guards and retrieve his helmet.
On the day of the unveiling of the Sentinels, Wolverine, Xavier, and Hank all make it to the event to find Mystique. As Nixon commences his speech, Erik, now reassuming his role as Magneto, comes down into RFK Stadium and lifts the entire place up, heading toward the White House. Xavier tries to locate Mystique in the crowd. The Sentinels begin to activate as Magneto is controlling them with the train track metal. Xavier locates Mystique disguised as a Secret Service agent as she thinks to herself "This is for you, brothers and sisters." She grabs her gun and starts walking toward Trask, but Xavier stops her. The Sentinels rise in the air to the awe of the crowd, until one of them begins to shoot at police cars, sending everyone into a frenzy. As everyone flees, the Secret Service take Nixon, Trask, and Stryker into the safe room in the White House, unaware that Mystique is among them. Magneto drops the stadium down around the White House, leaving one Sentinel within the area to stand guard.
Back in the future, the pods carrying the Sentinels makes its way to the monastery, dropping the Sentinels down. Kitty is losing her link with Wolverine as she's lost a lot of blood, but Xavier says they need just a little more time. Storm and Bishop prepare themselves for battle. Storm electrocutes Bishop so that he can absorb the power and use it as kinetic energy against the Sentinels. Magneto comes out, and with Storm's help, they send the X-jet into the pod to explode, throwing hundreds of Sentinels down. Magneto sees that he's been struck in his stomach with a metal part. A Sentinel then jumps from beneath the walls and impales Storm from behind, then throws her over the wall. They continue to take down the other mutants - Bishop blows himself up as the Sentinels fire against him, taking them with him; Colossus is ripped in two; Warpath is burned alive; Blink is impaled by three Sentinels at once; and Sunspot's neck is snapped.
Back in '73, Wolverine and Beast fight off the lone Sentinel. Beast tears into its fuel lines while Wolverine runs after Magneto. Magneto throws what he can at Wolverine, but he fights his way through. Magneto gets a block with rebars and wraps it through Wolverine's body, allowing him to throw Wolverine into the Potomac River, causing himself in the future to nearly break the link with Kitty. He then pulls the safe room out of the White House and turns all the live news cameras toward him. He gives a speech to everybody in the nation to listen, but mainly aimed at the mutants in hiding (this is seen by Quicksilver, Ink, and Toad). He encourages them all to come out of hiding and to join his brotherhood, for it is they who are the future. Mystique, disguised as Nixon, comes out to stop Magneto. The Sentinel runs toward them after passing Hank (he took the serum to revert to his human form), but Magneto pulls it apart. Mystique shoots and grazes him through the neck with a gun, and then knocks his helmet off to take him down. She then aims her gun at Trask, ready to kill him. In the future, the Sentinels get closer inside, killing Iceman despite him trying to hold them off. Xavier is able to get into Mystique's mind and convince her not to kill him. She drops the gun and flees under the guise of a soldier. Magneto gets up, and Xavier manipulates him into removing the metal bars off him so Hank can help him up. Magneto floats away. As the Sentinel in the future nearly kills the surviving mutants, they are all transported out of there.
Logan wakes up in a room in the Mutant Academy, which is clearly in the future. He steps outside and sees Iceman, alive. And then he sees Rogue (Anna Paquin). And then Kitty teaching a class with Colossus. He spots Storm walking with some students. The older Beast (Kelsey Grammer) greets Logan as he passes him. And then, to his surprise, he sees a red-haired woman standing by Xavier's office - Jean. Logan approaches her, stunned. He tries to touch her, but is stopped by someone else - Scott Summers/Cyclops (James Marsden)! After they leave, Logan finds Xavier, who tells him he (Logan) is teaching history. Logan admits that everything after 1973 is a bit of a blur. Xavier tells him, like he said (during the credits of "The Wolverine"), that they have a lot of catching up to do. He asks Logan what he remembers.
Logan recalls almost drowning, but he was pulled out by Stryker and his men. A newspaper is seen mentioning that Trask was arrested for selling military secrets. Stryker's eyes glow yellow, meaning it is Mystique that rescued Logan. The film concludes with Young Xavier asking "Is the future truly set?"
After the credits, we see hundreds of people bowing and chanting to Apocalypse and the Four Horsemen as they are seen constructing the Egyptian Pyramids.
You can send in your spoiler to other movies by going here.