Long ago, opposing factions of sentient robots, the Autobots and Decepticons, waged a great war that all but destroyed their home planet of Cybertron. The Autobots' leader, Sentinel Prime (voice of LEONARD NIMOY), devised a way for a victory, but his spacecraft crashed on Earth's moon in the 1960s. As a result, the American government, through its NASA program, sent man to the moon, not to explore the heavenly body, but to investigate the crash.
Since then, the Autobots, lead by Optimus Prime (voice of PETER CULLEN), and the Decepticons, ruled by Megatron (voice of HUGO WEAVING), have battled on Earth. With the help of human teenager Sam Witwicky (SHIA LaBEOUF), military forces including the likes of Captain Lennox (JOSH DUHAMEL) and Sgt. Epps (TYRESE GIBSON), and government agents such as Simmons (JOHN TURTURRO), the Autobots -- all of which can transform into other mechanical vehicles, such as Sam's bodyguard, Bumblebee -- seem to have defeated their enemies.
Even so, they now work undercover for the U.S. Government and Director of National Intelligence Charlotte Mearing (FRANCES McDORMAND), seeking out any signs of Decepticon activity. At the same time, recent college graduate Sam can't get a job, much to the chagrin of his father Ron (KEVIN DUNN), although his mother, Judy (JULIE WHITE), is more accepting. As is Sam's live-in girlfriend, Carly (ROSIE HUNTINGTON-WHITELEY), who supports them by working for wealthy businessman Dylan Gould (PATRICK DEMPSEY).
With a good word put in by him, Sam finally gets a job working for Bruce Brazos (JOHN MALKOVICH), an eccentric telecom and aerospace CEO. It's there that he has a run-in with coworker Jerry Wang (KEN JEONG) who just so happens to be under the control of a Decepticon. It turns out they as well as the Autobots are quite interested upon finally learning of the crashed ship on the moon, and it's Optimus Prime who reactivates Sentinel Prime.
But things don't go as planned and the Decepticons embark on activating a nefarious plan that will enslave all of humankind while being the end of the Autobots. With Sam thrust back into action, along with the military and Simmons and his personal assistant Dutch (ALAN TUDYK) among many others, the humans and Autobots work side-by-side in hopes of stopping their mortal enemies, including the highly destructive Shockwave (voice of FRANK WELKER).