Unicron, a colossal mechanical planet that consumes other worlds, heads toward Lithone, where its mechanoid inhabitants witness the horrifying destruction of their home. Only Kranix manages to escape, but as Unicron devours Lithone, it gains strength and sets its sights on Cybertron.
In the year 2005, the fierce battle between the Autobots and Decepticons has left the Autobots retreating to their moons while the Decepticons claim victory on Cybertron. Optimus Prime orchestrates a fuel transport mission to Autobot City on Earth, but the Decepticons, led by Laserbeak, ambush the Autobot shuttle, resulting in heavy casualties among the Autobots. An urgent distress signal is sent to the Autobot moon bases, but time is running out.
Reinforcements arrive, spearheaded by Optimus Prime, who promptly deploys the Dinobots to confront the gigantic Constructicon, Devastator. As the battle intensifies, Optimus engages in a fierce duel with Megatron. In a valiant struggle, while Megatron suffers severe injuries, Optimus sacrifices himself, passing the Matrix of Leadership to Ultra Magnus. The Decepticons, although shaken, retreat after sustaining significant losses.
In an unexpected turn, Starscream seizes the opportunity to discard Megatron and his injured forces into the void of space, where they become the prey of Unicron. Following a deal with Unicron to destroy the Matrix, Megatron is resurrected as Galvatron, equipped with a mind-control device that ensures his loyalty.
Upon arriving at Cybertron, Galvatron finds Starscream presiding as leader of the Decepticons and swiftly disposes of him to reclaim command. Shortly after, Unicron descends upon Cybertron, consuming its moons and all their inhabitants. Galvatron seizes the chance to attack Autobot City once more, forcing Ultra Magnus along with other Autobots, including Arcee, Springer, Blurr, Perceptor, and Kup, to devise an escape plan.
However, trouble brews for Hot Rod, Kup, and the Dinobots as they crash on Quintessa. Captured by the Quintessons and subjected to a sham trial, they witness the execution of Kranix. Just as the situation seems dire, the Dinobots rush in to rescue them, turning the tide of the battle. Grimlock uses his formidable strength to command respect from the Sharkticons, turning them against their Quintesson captors.
Meanwhile, in the aftermath of the battle on the Planet of Junk, Galvatron obliterates the Autobot shuttle and intends to harness the Matrix to dominate Unicron. Yet, the Autobots find themselves encircled by the hostile Junkions, who mistake them for invaders. With Hot Rod’s intervention, a tenuous alliance is formed, allowing the Autobots to regroup and confront Galvatron, who seeks the Matrix to gain power over Unicron.
Upon encountering Unicron, Galvatron attempts to leverage the Matrix but fails to open it, inciting Unicron’s wrath. The ensuing chaos culminates in a colossal battle. Hot Rod eventually grasps the Matrix in a moment of desperation, receiving a vision from Optimus Prime: > "Arise, Rodimus Prime." Transformed and empowered, Rodimus easily overcomes Galvatron, launching him into the void of space.
As Rodimus unleashes the Matrix's power, Unicron disintegrates from within, sending debris scattering across space. The Decepticons flee as their forces are decimated, leaving Cybertron free for the Autobots to reclaim. With the Great War officially ended, Rodimus Prime proclaims a new era of peace, ushering hope for all.