From a faraway galaxy, the evil robotic shape-shifters known as "Decepticons" land on Earth in search of the AllSpark, the creator of their universe. Its power will allow their leader, Megatron, to control Earth's machines and turn them against humanity. Simultaneously, the heroic Transformers, known as the Autobots, arrive to protect Earth. Their leader, Optimus Prime, sends his closest ally, Bumblebee, to transform into a car, which is bought by an awkward teenager, Witwicky, who is trying to impress his crush, Mikaela. However, this purchase is more than just a coincidence, as Witwicky's grandfather had made contact with aliens over a century ago. Meanwhile, the Secretary of Defense relies on a brilliant young computer hacker to uncover the mystery behind the invasion and the identity of the invaders.