The film begins with the news revealing that an Egyptian pyramid was stolen. When super-villain Gru (Steve Carell) hears of this, his pride is wounded and he plans to pull the biggest heist of the century by stealing the Moon.
Gru tries to get a loan from the Bank of Evil (Formerly Lehman Brothers) and meets a young super-villain, Vector (Jason Segel), who annoys him. Bank president Mr. Perkins (Will Arnett) refuses to grant Gru the loan until he obtains the shrink ray necessary for the plan. Mr. Perkins tells Gru that he is getting too old and that new super-villains are younger and better, like Vector, who is revealed to be the one who stole the Pyramid of Giza.
Gru and his minions steal the shrink ray from a top secret research facility in East Asia, but Vector steals it from him and shrinks his ship. Gru attempts to get the shrink ray back from Vector's lair, but all his attempts to enter the lair prove futile. After seeing three orphaned girls, Margo (Miranda Cosgrove), Edith (Dana Gaier), and Agnes (Elsie Fisher) enter the lair to sell cookies to Vector. Gru adopts the girls from Miss Hattie (Kristen Wiig), the head of the orphanage, to use them to steal back the shrink ray. Gru has his assistant Dr. Nefario (Russell Brand) build robots disguised as cookies. He then has the girls sell the robots to Vector, and the robots help Gru steal the shrink ray.
On the way home the girls ask to go to an amusement park. Gru agrees, intending to leave the girls there. Instead, the attendant says he, as an adult, has to ride the roller coaster with them. Gru ends up having fun with the girls. Back at home, he presents his plan to Mr. Perkins via video. The girls keep interrupting him. Perkins again refuses to give him the loan, claiming that although he doesn't have a problem with the plan, he just wants a younger villain to do it instead. Gru has a flashback of his childhood, depicting his wanting to go to the moon after seeing the first moon landing. When he tried to impress his mother (Julie Andrews) with models of the rocket (and an actual working one), she just ignored him. Mr. Perkins calls Vector (revealed to be his son, whose real name is Victor) to the Bank of Evil to inform him that Gru has the shrink ray. Vector reassures his father that he will get the Moon. Gru almost abandons his plan due to lack of funds, but the girls and the minions take up a collection to keep it going.
However, Gru has to make a choice, because the moon will be in the optimal position for the heist on the same day as the girls' ballet recital. Dr. Nefario, seeing the girls as a distraction, contacts Miss Hattie, who arrives to take the girls back. Gru, the Minions, and the girls are heartbroken. Gru goes on with his plan and flies to the moon.
Gru successfully shrinks and pockets the Moon. Gru remembers the ballet recital and rushes to it. However, it has ended by the time he arrived. There, he finds a ransom note from Vector demanding the moon in exchange for the girls. After Gru hands over the moon, Vector reneges on the deal, keeping the girls and the moon. This enrages Gru, who storms Vector's lair, this time successfully breaching the defenses. Vector flies off in an escape pod with the girls. Gru holds on to the exterior of the ship. He nearly falls to his death, but is rescued by Dr. Nefario piloting the same ship that Vector shrunk before. Nefario reveals that the bigger the object, the quicker the effects of the shrink ray wear off. Very soon, the moon begins to grow and roll around inside Vector's ship, hurting him and freeing the girls. The girls see Gru outside of the ship, and Gru tells them to jump over to him. Edith and Agnes successfully make it onto the ship, but before Margo can jump, Vector grabs her. The moon rolls again and knocks Vector over, and Margo grabs onto Gru's grappling hook. Gru rescues her with the help of his minions, while the rapidly-expanding Moon wrecks Vector's controls, causing his ship to carry it back into orbit.
Gru and the girls settle down to live a happy life as a family and Vector is stranded on the Moon. The girls give a special ballet recital for Gru, his minions, and his mother, who finally tells him she is proud of him and acknowledges him to be the better parent. The music changes from Swan Lake to You Should Be Dancing, and everyone rushes on stage to dance as the film ends.