Megamind (Will Ferrell) is a super-intelligent alien and the supervillain of Metro City who continually battles - and loses - against his nemesis, Metro Man (Brad Pitt), a rivalry that has extended since the two arrived on Earth as infants.
On the day of dedication of a museum in Metro Man's honor, Megamind escapes from jail, rejoins his sidekick Minion (David Cross), and kidnaps reporter Roxanne Ritchi (Tina Fey) to lure Metro Man into a copper-lined observatory. Inside, Metro Man weakens because copper drains his powers and is killed by a death ray that Megamind fires at the observatory from an orbiting satellite. Megamind revels in his victory, but this is short-lived as without a nemesis, his villainy has no purpose.
While saying good-bye to Metro Man's statue and attempting to destroy the Metro Man museum because it brings back too many painful memories, Megamind uses a holographic disguise of the curator, Bernard (Ben Stiller), after Roxanne hears his voice. She unwittingly gives him the idea of creating a serum containing Metro Man's DNA to inject in a worthy target, thus creating a new superhero for Megamind to fight. Later, as Megamind finishes the serum in his lair and locates a worthy target, Roxanne sneaks into the lair, and in the resulting chaos, Megamind injects the serum into Roxanne's dimwitted camera man, Hal (Jonah Hill). Megamind disguises himself as Hal's "space dad" to groom the new hero into shape to fight Megamind in a few days. Hal takes the superhero alias of "Tighten," a result of mishearing Megamind's suggestion of Titan. During this, Megamind, in the Bernard disguise, continues to see Roxanne and becomes close to her, unaware that Hal also has romantic feelings for her. Minion expresses discontent at Megamind's lack of villainy and they break their friendship when Minion finds out he has fallen for Roxanne.
On the night before the battle, while dining with Roxanne and gaining their first kiss together, the holographic disguise fails revealing his identity, and Roxanne angrily rejects him in the rain upon finding out Megamind's true feelings towards her, dismissing the idea that they could ever be together. Furthermore, he loses track of his invisible car that has the anti-serum to restore Hal to normal. Heartbroken, he vows to fight Hal the next day, but Hal does not show up at the appointed time. Megamind finds a bitter and equally heart-broken Hal (who witnessed Roxanne and "Bernard" having dinner) having used his powers for ill-gotten gains. Megamind is horrified at this change and attempts to convince Hal to be a "hero" by revealing how he has manipulated Hal by revealing his space dad and Bernard disguises. Hal realizes he has been toyed with and battles Megamind. When defeated, Megamind is shocked to learn that Hal actually wants to kill him and tries to escape. Megamind attempts to capture Hal in a copper-lined trap, but it fails to weaken Hal, which confuses him, and the villain is forced to flee Metro City, while Hal begins to threaten the city with his powers.
Megamind meets with Roxanne who takes him to Metro Man's secret lair, which happens to be the schoolhouse both Megamind and Metro Man attended in their childhood, and the two are surprised to find Metro Man there. The former hero explains that on the fateful day, he had an epiphany and pretended to have a weakness for copper and be killed as to forgo the superhero career and become a musician. He refuses to help stop Hal. Roxanne tries to convince Megamind that he could be the hero, but Megamind has resigned himself to be the villain and returns to prison. When Hal kidnaps Roxanne and threatens her life if Megamind does not fight him, Megamind has a change of heart and requests the warden to let him go, surprised to find Minion had disguised himself as the warden.
Megamind rescues Roxanne, but is defeated after Metro Tower's pinnacle thrown by Hal pierces his chest. But Metro Man shows up and chases Hal away. While dying, Megamind reveals he is actually Minion in holographic disguise (and only his armor is destroyed) and Metro Man is actually Megamind. Tighten runs away, but upon realizing "Metro Man" said Metro City in Megamind's trademark way which sounds similar to monstrosity, comes back after Roxanne turned Megamind back to his original form. In the fray, Megamind discovers his misplaced invisible car. He grabs the Antidote and heroically defuses the serum out of Hal with it, reverting the Tighten to a normal man. Hal is taken away to jail while Roxanne convinces Metro City's citizens that Megamind chose to be their hero. Later, Megamind and Roxanne's relationship has become close, and the city welcomes Megamind as their new protector, while a disguised Metro Man, hidden in the crowd with his grown beard, quietly congratulates him.
During the credits, Minion washes Megamind's pants when Bernard (who was dehydrated by Megamind at the Metro Man museum) emerges from the washing machine and Minion hits him with the forget-me stick.