In a dystopian 2023, mutants are being hunted to near extinction from the Sentinels. In Moscow, Warpath, Blink, Bishop, Shadowcat, Colossus, Sunspot and Iceman are preparing to fight the Sentinels. The Sentinels arrive and kill all the mutants but Shadowcat and Bishop, who survives because Shadowcat has sent Bishop's consciousness to an early time.
Professor X, Magneto, Wolverine and Storm arrive to find mutants hiding in Mongolia, where they plan to send Professor X back to 1973 to stop Mystique from killing Bolivar Trask, which triggered the Sentinel Program. However, Wolverine volunteers to go back due to his regenerative powers, and because Professor X couldn't physically handle going back decades. As the X-Men hide themselves in a monastery, Wolverine is sent back to the past by Shadowcat before asked by Professor X and Magneto to unite them together.
Wolverine wakes up in 1973, and eventually arrives at the disused mansion, where he makes a rough encounter with Hank McCoy. Wolverine finally sees Charles and asks his help, who reluctantly agrees. They plan to break Erik out of prison for killing President John F. Kennedy. The three first head to Peter Maximoff’s house and asks him to help. Meanwhile Trask asks for funding for his Sentinel program but is denied. In Saigon, Mystique rescues Havok, Ink, Toad and Spyke while finding Trask.
At The Pentagon, Charles, Wolverine, Quicksilver, Hank sneak into the facility and free Erik. Onboard a plane, however, Charles and Erik argue over how they each abandoned each other. Meanwhile Mystique impersonates a general at a meeting in Paris where she plans to kill Trask, but is unsuccessful as William Stryker incapacitates her. Wolverine, Charles, Erik and Hank arrive, where Erik plans to kill Mystique to prevent the program. She is shot in the leg before escaping through the window. Erik chases after her and pulls the bullet out of her leg and plans to kill her with that bullet, but Beast attacks Erik while Mystique escapes.
Meanwhile Wolverine sees Stryker and has traumatic flashbacks. In 2023, Wolverine starts violently shaking and stabs Shadowcat with his claws. Back in 1973, he briefly does not know why he’s there and who young Charles is. President Nixon eventually agrees to Trask’s program and arranges an unveiling in Washington DC. Magneto breaks into Trask’s Industries and steals the design plans of the Sentinels and readjusts the Sentinels onboard a train to DC. Back at the mansion, Charles eventually refuses to take a serum, which allows him to walk again but lose his powers, and uses Cerebro to find Mystique.
His mind is not focused and telepathically talks to the older Professor X where he is asked to hope again. As Wolverine, Professor X and Hank go to the unveiling of the Sentinels to find Mystique, the Sentinels begin attacking the public, where Nixon and Trask are taken to a safe room, followed by Mystique in disguise.
Magneto lifts an entire stadium and transports it to surround the White House and puts all but one Sentinel on lookout, and makes it to go after Wolverine and Beast. Wolverine attacks it but Magneto stabs him with reinforcement steel then drowns him in a nearby river. At the same time in 2023, Storm, Bishop, Colossus, Warpath, Sunspot, Iceman and Blink are killed protecting the monastery. When Trask discovers Mystique is in the safe room, Magneto pulls the safe room out of the White House.
Beast injects himself with the serum to turn back into his human form so that the Sentinel will not attack him. Mystique slightly grazes Magneto with a plastic gun before being convinced by Professor X via telepathic powers to not kill Trask. Back in 2023, the Sentinels are close to firing upon the X-Men but everyone disappears. Logan wakes up back in the school and sees that Ororo, Kitty, Peter, Bobby, Hank, Marie, Jean and Scott all have survived. Logan finds Charles, who lets him know that they have a lot of catching up to do. Back in 1973, Mystique, impersonating Stryker, recovers the drowning Wolverine from the water.
In a post-credits scene people are seen bowing and chanting to En Sabah Nur.