Millions of years ago the Autobots and Decepticons fought a great war on Cybertron that resulted in the Decepticons being driven from the planet. As Optimus Prime watches a historical video, Ratchet questions why he bothers to think about a war that ended ages ago. Optimus stresses his belief in history being a good source to learn from. Soon they find Bulkhead stuck to a chunk of rock outside so the Autobots work together to free him. The crew has to clear some rocks blocking a Space Bridge. Optimus encourages the team to work together, but the always independent Prowl is not big on team work, choosing instead to work alone. Without warning, the Space Bridge activates, sending the Autobots fyling everywhere. Through swift action OptimusPrime rescues the Autobots, impressing his crew. He explains that he trained at the Autobot Academy, leading the others to wonder why he is on a Space Bridge repair ship. All questions stop when he uncovers a mysterious device that Ratchet immediately recognizes as the legendary Allspark! He believes it isn't meant to be found, but Teletran-1 detects a Decepticon warship coming, so they quickly head back to their ship with the Allspark.
Inside the ship, Ratchet explains that the Allspark is real, and everyone recognizes it as the source of Transformers life. When the Decepticon ship gets close, Optimus decides to get help from Cybertron. He contacts Ultra Magnus, who agrees to send a strike force to help. Optimus decides to take action in the meantime, dodging the Decepticon vessel as best he can. The Autobots head to the nearest Space Bridge, but the Decepticon vessel gets in their way.
Onboard the Decepticon ship, Megatron decides to invade the Autobot ship himself. Starscream is not convinced this is real and instead sets his leader up for failure by planting a device on him to overload his circuits. Megatron attacks the Autobot ship, but Optimus manages to distract him using the ship's robotic arms. When the device goes off on Megatron, his cannon explodes and the ship goes out of control. As the Autobots regain control of the ship, they discover Megatron has snuck onboard! His cannon arm is gone, but he is still dangerous.
On the Decepticon ship, Starscream is ready to declare himself leader but realizes the other Decepticons have already escaped. The Autobot ship winds up going through a Space Bridge, which the Allspark destroys after they enter. The resulting explosion tears a gigantic hole into the Decepticon ship, stopping it from pursuing the Autobots.
Having wound up in orbit of Earth, the ship begins to enter the atmosphere out of control once again. Optimus manages to throw Megatron out an airlock and then focuses on getting the ship back under control. He orders the others to the Stasis Pods and makes sure the ship does not crash in a populated area. As the ship lands in Lake Erie, he manages to get into a Pod himself. Meanwhile, a young Sumdac finds a gigantic robot crashed in a field near his house - it is Megatron unconscious!
Fifty years later, the city of Detroit has become a booming industrial center that produces robots. The brilliant Professor Sumdac gives a tour of his manufacturing facility. During this tour we meet his daughter Sari who winds up chasing her robot dog, Sparkplug around. We also see her security key, which she wears around her neck. He shows a lab where work is being conducted on nanobots for medical purposes. However, the experiment quickly goes out of control and an insect that was being experimented on begins to grow out of control, merging with everything around it including filing cabinets! Everyone is forced to evacuate the facility and the police and emergency crews quickly head to the factory including Captain Fanzone who commands these units.
The rescue workers evaculate the building while the police fight it. However Sari is still inside looking for Sparkplug. When the police blow up the bug, a piece of it falls into the lake and enters the Autobot ship, awakening its security measures - forcing the Autobots out of stasis. The police victory is short lived however as the pieces of the creature start to reform into the giantic insect once again! Inside the ship, Ratchet manages to capture the small piece of the insect. Using Teletran-1's satellite, the Autobots see the creature attacking the police and decide to assist them. Fearing the Decepticons might be watching, Optimus decides the Autobots need to take on local life form disguises, which the Autobots interpret as the police vehicles. One by one the Autobots each take a vehicle form. Ratchet stays behind to figure out what the strange intruder is while the others head out to fight it.
Captain Fanzone orders his people to clear away from the scene, deciding to only use armed robots to fight the insect. The small helicopter like drones attempt to destroy the insect but to no avail. When he sees the Autobots in disguise near the creature, he thinks it's his men until he sees "his car" and the other vehicles without drivers!
Before the Autobots can do anything else, Sari comes running out of the building with Sparkplug. The Autobots mistake her for a pet and Sparkplug as the owner. The Autobots try to introduce themselves but scare Sari right into the arms of the insect. They quickly transform and rescue her, with Bumblebee catching her and taking her to safety while the others battle the insect. The police witness the Autobots transforming and are awestruck. They try to battle the creature but Prowl is quickly sucked into the insect's body.
Back at the Autobot ship, Ratchet analyzes the nanobot segment and discovers that he needs to reprogram the nanobots to render them harmless. To do so however, the program must be inserted manually. They decide that being the smallest and fastest of the Autobots, Bumblebee is ideal for this task. The Autobots distract the creature while Bumblebee executes the plan, and soon the insect is defeated! Unfortunately the victory is not without consequence. Prowl has been severely damaged and is quickly taken back to the Autobot ship. Sari sneaks in with the Autobots by stowing away inside Bumblebee, unbeknownst to the others.
Ratchet tries to repair Prowl, but has little luck. Meanwhile, Sari stumbles onto the Allspark and a transfer of information occurs between her and the mysterious device. Suddenly, the Allspark changes the key around her neck into something else, and after she is discovered by Optimus Prime, she is taken to the medlab where the key around her neck glows and leads her to the operating table where it goes on to revive Prowl! Everyone is amazed,e specially Prowl.
The Autobots soon return Sari to her father. At first they are treated with suspicion, but when Sari vouches for them they become Detroit's new super heroes! A press event is held where they are introduced to the world by Professor Sumdac.
Elsewhere, Starscream has found the Allspark signature after years of searching and heads to Earth.
On Earth, the Autobots are acclimating to their new environment. Sari eventually takes them to an old building owned by Sumdac that he never uses. The idea is to make it their new base within the city. Before they can work on the base however a building is on fire and the Autobots go to help save its residents. Above, Starscream watches and plans his next move.
The next day, they attend a press event unveiling Sumdac's new train which can reach speeds over 300 MPH. High above, several jets are patrolling US air space when they are suddenly attacked by Starscream! He battles the jets but quickly tires of it. Instead, he scans the last jet and takes on the jet form as his new disguise. When a team of similar jets put on a show of Sumdac's train, he suddenly realizes there is an extra jet! The jet swoops in and attacks the Autobots, revealing itself to be Starscream!
The Autobots battle Starscream, but being inexperienced none of them are a match for him alone. He explains that he is the one who defeated Megatron by overloading his circuitry, telling the Autobots that they don't deserve the title of "hero". He begins firing on the humans who run to the train for cover. When Starscream fires a shot that threatens to hit Sari, Bumblebee jumps in the way, taking the full brunt of the blast! He tells the Autobots they have one Mega-Cycle to bring the Allspark to him or he will destroy the train and his hostages including Sumdac and Bumblebee.
The Autobots decide to execute a plan by Sari to distract Starscream using the Allspark while Prowl and Sari sneak the hostages out. Sari uses her key to reactivate Bumblebee. With Sari still inside, the train almost goes over the edge of a building but Prowl and Bumblebee manage to hold it in place, that is until Starscream blasts them from behind! Bumblebee gets Sari out of the train while Prowl keeps it from hitting anyone below. Soon, the Autobots play a game of "keep away" with the Allspark, passing it to each other to keep out of his hands. This only works temporarily until he blasts Optimus and takes the Allspark! He begins utilizing its energy to destroy everything around him. Optimus grabs one end and he and Starscream wind up playing a tug of war with it. Eventually the casing opens, causing an energy surge that sends Starscream packing but also critically damages Optimus Prime.
Sari uses her Key and the Allspark to bring Optimus back to life. The Autobots quickly set to work to fix the damage done by the latest battle. Inside Sumdac's personal lab, he regrets not being able to tell Detroit's heroes the truth behind his robotics empire: the disassembled form of a Decepticon known as Megatron!