65 million years ago, an alien race known as "the Creators" invade prehistoric Earth. Meanwhile, a competition between dinosaurs occurs as they fight over a dead young dinosaur for food. The Creators then wipe out most of life on the planet with "Seeds". The Seeds are then seen inflicting damage and destruction upon those who are in the ground until halfway up to the mountains thanks to the place being a valley. One mature yet small dinosaur, who joined the competition earlier, is seen and survives the attack. In the present, the public has become fearful of Transformers following the Battle of Chicago five years ago and the U.S. government has terminated all joint operations with the Autobots. Cemetery Wind, an elite CIA black ops division formed by Harold Attinger, was requested to destroy the remaining Decepticons. However, they have also been hunting down Autobots, believing that all Transformers are a threat (casualties involve Leadfoot, Sideswipe, and Arcee). Aided by Cybertronian bounty hunter Lockdown, Cemetery Wind tracks down and severely cripples Ratchet while the medic was trying to flee, he refuses to expose the whereabouts of Optimus Prime, whom Lockdown wants alive which causes the latter to rip out Ratchet's spark, thus killing him.
In Texas, financially struggling inventor Cade Yeager and his friend Lucas Flannery discover an old truck in an abandoned theater and buy it to repair and sell it for Cade's daughter, Tessa, and her college funds. Cade discovers that the truck is an injured Optimus and revives him. Having tracked them down, Attinger's right-hand man James Savoy leads Cemetery Wind to the Yeagers home where they threaten the family and Lucas just before Optimus rescues them. Cade, Tessa and Lucas escape with Tessa's secret boyfriend, Shane Dyson, but after a lengthy chase, Lucas is killed by Lockdown's grenade. Optimus upgrades himself and gets a new vehicle mode, the crew find the remaining Autobots who escaped Lockdown and Cemetery Wind, in the desert where it is discovered that without Optimus to guide them, the remaining Autobots Bumblebee, Hound, Drift, and Crosshairs are constantly bickering and psychically assaulting each other over leadership and opinions . Using a spy drone Cade took during the attack, the Autobots learn of Kinetic Solutions Incorporated (KSI), a technology firm partnered with Cemetery Wind, and decide to infiltrate KSI headquarters in under-reconstruction Chicago.
Meanwhile, Joshua Joyce, KSI's founder, reveals he has imprisoned Brains to decode dead Transformers' minds for raw materials and utilize their data for human-created Transformers. The Autobots storm KSI, but Joshua stops them, proclaiming they are no longer needed. Disillusioned, the Autobots leave the facility. Forced by Attinger, Joshua launches prototypes Galvatron and Stinger, created using data from Megatron and Bumblebee, to pursue the Autobots. Optimus fights Galvatron, who becomes autonomous due to Megatron's influence, but the fight is cut short when Lockdown disables Optimus, capturing him and Tessa; Lockdown reveals that the Creators want Optimus back.
Lockdown moves his ship into downtown Chicago to give Savoy a Seed, allowing the Autobots to board the ship and rescue Optimus and Tessa, escaping using a detachable part of Lockdown's ship. Meanwhile, Joshua decides to retreat to China for production facilities. Optimus explains to Cade that Galvatron is actually Megatron, who has been plotting to steal the Seed so he can rebuild his Decepticon army. Cade contacts Joshua and warns him about Galvatron and Attinger. Joshua, now aware of Attinger's true motivations and intentions, betrays him. Elsewhere, Galvatron activates himself and infects all KSI prototypes, transforming them into Decepticons. Joshua flees with the Seed to Hong Kong, with Attinger and Galvatron in pursuit.
When the Autobots try to retrieve the Seed in Hong Kong, their ship is shot down by the Decepticons, leaving Bumblebee, Hound, Cade, Tessa and Shane to run and fight. Cade and Savoy fight, which ends in Cade pushing Savoy many stories down to his death from an apartment building. With the Decepticons overwhelming the Autobots, Optimus releases and tames legendary warriors, the Dinobots, who assist them in fighting the Decepticons, where Bumblebee successfully kills Stinger. Afterwards, Lockdown returns and confronts Optimus. When Cade arrives to help Optimus, he is held at gunpoint by Attinger. Optimus saves Cade by blasting Attinger dead, but Lockdown impales Optimus with his sword. Cade and Bumblebee fight and manage to distract Lockdown long enough for Tessa and Shane to pull the sword from Optimus' chest, which Optimus uses to finally kill Lockdown, and with Lockdown and Attinger dead, all the Autobots the duo hunted down are avenged. Witnessing the Autobot victory, Galvatron retreats, with an ominous promise to return now that he is reborn meanwhile a few of the infected Decepticons flee and the remains of Lockdown's bounty hunter crew flee the planet. Optimus, Cade, Tessa and Shane reunite with the other Autobots, and Optimus sets the Dinobots free who transform and flee into the wild. After asking the Autobots to protect the Yeagers, Optimus flies into space with the Seed, sending a message to the Creators that he is coming for them.
- The Griffin Family (Peter, Lois, Chris, Meg, and Stewie), Vinny Griffin, Glenn Quagmire, Cleveland Brown, Joe Swanson, Blythe Baxter, Zoe Trent, Pepper Clark, Penny Ling, Vinnie Terrio, Sunil Nevla, Minka Mark, Russell Ferguson, Gail Trent, Mitzi, Buttercream Sunday, Sugar Sprinkles, Belle, Ariel, Princess Jasmine, Kida Nedakh, Little Bear, Duck, Cat, Owl, Hen, Emily, Lucy, Doug Funnie, and Skeeter Valentine guest star in this film.
- Ernie the Giant Chicken, Sideshow Bob, Bobby Briggs, Team Galactic (Mars, Jupiter and Saturn), and The Dazzlings will work for Harold Attinger in this film.
- The My Little Pony: Equestria Girls franchise, Littlest Pet Shop, and Transformers were both made by Hasbro.
- Sideshow Bob and Harold Attinger are both played by Kelsey Grammer.
- The storyline continues in Brian and the Eeveelution Family's Adventures of Transformers: The Last Knight.
- Despite not singing a song in the film, this film will be dedicated to Chester Bennington who sang songs for the first three films.
- The events from Thomas and Twilight Sparkle find Atlantis The Lost Empire will be mentioned in this film.
- The movie begins
- Meeting Cade Yeager
- Ratchet's death
- Cade's discovery
- Optimus Prime awakes
- Cemetery Wind Chase
- At the gas station
- Reuniting with the Autobots/Getting answers
- The KSI Industries
- Sneaking and attacking the industries
- Freeway chase/Optimus vs. Galvatron/Lockdown captures Optimus and Tessa
- On Lockdown's Ship
- The Story of the Seed
- To Hong Kong!/Galvatron Rises
- Arrival at Hong Kong/Savoy, Bobby Briggs, and Team Galactic's deaths
- Battling the KSI Robots
- The Dinobots unleashed!/Sideshow Bob's defeat
- Lockdown returns
- Optimus vs. Lockdown/Lockdown, Attinger, and Ernie's deaths
- Optimus leaves/End of Film
- Star Wars Episode II: Attack of the Clones - Chase Through Coruscant (during the Cemetery Wind chase)
- Pokémon 3: The Movie - Melt the Crystal Glass (during the escape from Lockdown's ship)
- Pokémon Heroes - Going to Latios! (during the ship chase)
- Pokémon Ranger and the Temple of the Sea - As Long as I Can Hold My Breath (during Optimus and Lockdown's duel)
- Pokémon Heroes - Sortie! (when Optimus finally kills Lockdown)
- One More Light - Linkin Park (for the end credits)