In 484 AD, King Arthur and his knights battle against the Saxons. Elsewhere, Merlin approaches the Knights of Iacon, a group of Transformers hiding on Earth, to help win the war. They hand him an alien staff, before transforming together into Dragonstorm, warning Merlin that a great evil will come for the staff.
In the present, a year after the Hong Kong Uprising, Optimus Prime crash-lands on Cybertron, and meets his alleged creator Quintessa. She blames Optimus for Cybertron's destruction and brainwashes him into helping to gain Merlin's staff, which can absorb Earth’s energy to restore their homeworld. Earth is revealed to be the slumbering Unicron, whose horns are emerging across the planet.
On Earth, Transformers remain unwelcome amongst humanity, apart from in Cuba, and are hunted by the Transformers Reaction Force (TRF), a paramilitary force manufactured from the fallen Cemetery Wind. Cade Yeager, an ally to the Autobots, helps hide refugees from the TRF in his remote junkyard. In the war-torn Chicago, Cade, Bumblebee, street-wise scavenger Izabella and her Transformer companions Sqweeks and Canopy help a group of children evade the TRF drones, but Canopy is killed. Cade receives a mechanical talisman from a dying Autobot knight and has a brief standoff with the TRF before heading back to his junkyard with Izabella and Sqweeks. Both Megatron and the American military become aware of the talisman’s value and power, reluctantly joining forces to obtain it. A group of Decepticon prisoners are released to aid in the mission.
The Decepticons and the TRF locate Cade's hideout thanks to a tracker that the TRF had planted on Bumblebee during the standoff. Cade, his assistant Jimmy, Izabella, and Sqweeks flee from the Decepticons and the TRF to an abandoned town where the Autobots ambush their enemies and defeat them while Cade, Jimmy, and Izabella battle a unit of TRF drones. Cogman, a steampunk Transformer, approaches Cade and invites him to travel to the United Kingdom and meet his employer, Sir Edmund Burton, who has connections to the Transformers. Burton also has his associate, Hot Rod, bring Viviane Wembley, a University of Oxford English Literature professor, to his estate. Along the way, Hot Rod gains an alternate form.
Bringing Cade, Viviane, and Bumblebee together, Burton explains that Transformers have been aiding mankind in war for centuries, their existence hidden by a secret society of historical figures known as the Order of Witwiccans and that he is the last living member. The talisman can lead to Merlin’s staff, buried with him in a Cybertronian spacecraft hidden at the bottom of the sea. However, only a direct descendant of Merlin can wield it, revealing Viviane is the last in his bloodline. The TRF and the local authorities discover them, forcing them to flee. Following a series of clues while evading their pursuers, the group all head to the Royal Navy Museum. There, Cade, Viviane, Bumblebee, and Cogman commandeer the HMS Alliance (after Burton shuts the attraction down, evicts the tourists, and reveals that the submarine itself is a Transformer) to find the spacecraft, followed by the TRF in their own submarines.
Burton later contacts Seymour Simmons, both learning that Earth is Unicron, and the staff will be used to drain the planet’s life, via an access point hidden under Stonehenge. Locating the ship, Cade and Viviane discover Merlin’s tomb and obtain the staff. Viviane activates it, causing the spacecraft to become airborne, awakening the Knights of Iacon. As the TRF try to take the staff from them, Optimus arrives, forcing them to surrender the staff. Bumblebee and Cade confront Optimus who engages in battle with Bumbleebee. Just as Optimus is about to strike the killing blow, the formally mute Bumblebee begins speaking in his own voice, stirring Optimus' memories and freeing him from Quintessa's control. Megatron and Nitro Zeus then ambush Optimus, Bumblebee and Cade and Megatron steels the staff from Optimus. The Knights try to execute Optimus for his presumed betrayal, but Cade stops them when his talisman transforms into Excalibur and the Knights yield to him. Burton tries to stop Megatron as he activates the staff at Stonehenge only to be mortally wounded by Megatron. Burton then dies peacefully with Cogman at his side.
The Autobots and human military forces then converge on Stonehenge. They then engage the Decepticons and Quintessa's minions, who either flee or are killed while Quintessa is seemly destroyed by Optimus and Bumblebee. The worlds are then saved upon Viviane removing the staff and the Autobots leave Earth to rebuild what is left of Cybertron.
In a mid-credits scene, Quintessa, who has survived and is disguised as a human, approaches a group of scientists inspecting one of Unicron’s horns, offering a way to destroy him.
- The Griffin Family, Vinny Griffin, Glenn Quagmire, Cleveland Brown, Joe Swanson, Little Bear, Duck, Cat, Owl, Hen, Emily, Lucy, Doug Funnie, Skeeter Valentine, Roger Smith, Bender Bending Rodríguez, Minerva Mink, The Crystal Prep Girls, Wubbzy, Widget, Walden, Daizy, The Young Six (Silverstream, Smolder, Ocellus, Sandbar, Gallus, and Yona), Blythe Baxter, Zoe Trent, Pepper Clark, Penny Ling, Vinnie Terrio, Sunil Nevla, Minka Mark, Russell Ferguson, Gail Trent, Mitzi, Buttercream Sunday, Sugar Sprinkles, Nutmeg Dash, Youngmee Song, Sue Patterson, Jasper Jones, Belle, Ariel, Princess Jasmine, Princess Anna, and Elsa the Snow Queen guest star in this film.
- Ernie the Giant Chicken, Sideshow Bob, R2-Q5, Bobby Briggs, New Brian, The Dazzlings, Hunter J, and Team Galactic (Mars, Jupiter and Saturn) will work for Harold Attinger in this film. will work for will work for Megatron in this film.
- The My Little Pony: Equestria Girls franchise, Littlest Pet Shop, and Transformers were both made by Hasbro.
- In this film, Team Griffin/Eeveelution, Vinny, Stewie, Peter, Quagmire, Cleveland, Joe, Little Bear, Duck, Cat, Owl, Hen, Emily, Lucy, Doug, Skeeter, Roger, Minerva, the Crystal Prep Girls, Wubbzy, Widget, Walden, Daizy, the Young Six, the LPS gang, Gail Trent, Mitzi, Buttercream Sunday, and Sugar Sprinkles will go with Cade and Bumblebee, while the others stay with Izzy, Jimmy, and the other Autobots.
- Opening with Patchy
- The Dark Ages/In the present
- At the Chicago ruins/Izzy's introductions
- Megatron's return/With the villains
- Optimus' arrival on Cybertron/Quintessa
- Viviane and Edmond's introductions
- With the others and other Autobots/Izzy and Selena join the crew
- The mysterious horns/Tessa calls Cade
- Alliance with Megatron and Ernie
- Decepticon and Drone chase/Meeting Cogman
- Flying to the UK/The Rise of Nemesis Prime
- Vivane captured/Meeting Sir Edmond Burton
- The Story of the Transformers
- Finding the clues/Road chase
- Hopping aboard the Sub/Submarine chase
- Burton talks to the prime minister
- Finding the Knight Ship
- Arrival of Cybertron
- Finding Merlin's staff
- Nemesis Prime vs. Bumblebee
- Race to Stonehenge
- Flying to Cybertron/The battle on Cybertron
- Battling Quintessa and Megatron
- The Autobots return to Cybertron/Quintessa's still alive!/cliff hanger ending
- Pokémon Ranger and the Temple of the Sea - Fearow (Capture On) (during the car chase)
- Black Lab - Transformers (for the end credits)