In 1961, the Ark, a Cybertronian spacecraft carrying an invention capable of ending the war between the Autobots and Decepticons, crash lands on the far side of Earth's Moon. The crash is detected on Earth by NASA, and President John F.Kennedy authorizes a mission to put a man on the Moon as a cover for investigating the craft. In 1969, the crew of Apollo 11 lands on the Moon to explore the craft.In the present, the Autobots assist the United States military in preventing conflicts around the globe. During a mission to Chernobyl to investigate suspected alien technology, Optimus Prime finds a fuel cell from the Ark, discovering it had survived its journey from Cybertron. The Autobots are attacked by Shockwave who manages to escape. After learning of the top-secret mission to the Moon, the Autobots travel there to explore the Ark. There they discover a comatose Sentinel Prime – Optimus' predecessor as leader of the Autobots – and his creation, the Pillars, a means of establishing a Space Bridge between two points to teleport matter. After returning to Earth, Optimus uses the energy of his Matrix of Leadership to revive Sentinel Prime.
Working together, the Autobots and Human soldiers manage to rescue Carly and destroy Soundwave, Barricade, Starscream and Shockwave, with Optimus using Shockwave's arm-cannon to blast the Control Pillar, disabling the Space Bridge. Sam confronts Gould as he reactivates the Control Pillar. After a brief fistfight, Sam knocks Gould into the Pillar, electrocuting him. Bumblebee and Ratchet arrive and destroy the Control Pillar, permanently disabling the Bridge and causing the partially transported Cybertron to implode. Optimus and Sentinel fight while Carly convinces Megatron that he will be replaced as leader of the Decepticons by Sentinel. Sentinel severs Optimus's right arm and prepares to execute him when Megatron intervenes, incapacitating Sentinel. Optimus attacks Megatron, decapitating and killing him. Sentinel pleads for his life but Optimus executes him for betraying his own principles. With the Decepticons defeated, Carly and Sam are reunited and the Autobots accept that with Cybertron gone, Earth is now their home.