With the help of the escaped exhibits from New York, and the aid of General Custer, Larry is able to finally defeat Kamunrah by sending him to the underworld. Amelia Earhart then flies him and the exhibits back to New York, and is able to return to Washington by sunrise.
Two months later, the museum re-opens with "special extended hours" (i.e. open at night....still don't get it?....night...as in when the exhibits....forget it you'll have to se the movie). It is revealed that Larry sold his company because he was much happier working as night watchman, and on the night of the reopening he meets a girl who represents Amelia Earhart, who was his love interest for the story.
With the events of the first movie, Larry (Ben Stiller) gained enough confidence in himself to start his own business, which turns him into a workaholic who is barely able to spend real quality time with his son.
For renovations, the Museum of Natural History sends several of its more memorable exhibits to federal storage underneath the Smithsonian museums in Washington, DC. In transit, Dexter the monkey steals the tablet, which causes all the exhibits around DC to come to life. Among the objects brought to life, we meet General Custer, Amelia Earhart (Amy Adams), Ivan IV (Ivan "The Terrible"), Napoleon Bonaparte, Al Capone, the Thinker, Abraham Lincoln, Able the first monkey to travel in outer space, Oscar the Grouch, Darth Vader, and Kamunrah (Hank Azaria).
Kamunrah is the older brother of Ahkmenrah, and he wants the tablet because he can use it to open the doorway to the underworld and summon the Egyptian armies of the undead. He locks up the NY exhibits (Sacajawea, Attila the Hun, the mini Romans and Cowboys) along with General Custer. Jedidiah and Octavius manage to escape through a rust hole, but Jedidiah is caught by Capone's thugs. Octavius gets away.
Larry lets him take the tablet, as he is holding Jedidiah hostage. When Kamunrah cannot figure out the proper combination, he sends Larry and Amelia Earhart to find it. They find out through a bronze bust of Teddy Roosevelt that the secret lies in the pyramids. Meanwhile, Octavius tries to make his way across the White House lawn when he is confronted by a squirrel that carries him away.
At the museum of air and space, the Einstein bobbleheads reveal that the secret number of the pyramids is in fact pi (3.14159265, a number that in the real world has absolutely nothing to do with anything remotely related to straight edged pyramids). Al Capone and his men kidnap one of the Einsteins for leverage over Larry when he refuses to give the code without Jedidiah being released. Kamunrah enters the code and opens the door to the underworld, where he summons the minions of Osiris at his command. Just before he can give the order to kill, Octavius interrupts on his steed, the noble squirrel, in tow behind him is the statue of Abraham Lincoln, whose stone hide outmatches the spears of the Egyptian demons, who fly screaming back into the gateway and close the door. Meanwhile, Amelia releases the imprisoned exhibits, and both sides go to war. Larry instills a bit of confidence in General Custer and takes on Kamunrah sword to flashlight. As Larry subdues Kamunrah, Amelia puts in the combination and opens the door to the underworld, where Larry sends Kamunrah.
After the dust settles, Larry realizes that his place was always at the Museum of Natural History in New York. Amelia offers to fly him and his exhibits back to New York in her own plane on display at air and space. When the exhibits get back, everyone is happy, including Larry, who kisses Amelia goodbye, and tells her that they would have done well as a couple if she weren't a museum artifact. Amelia claims to have known this all along, and only tagged along with Larry because he was the most fun person she had ever known.
Two months later, the Museum of Natural History reopens, with special extended hours to take advantage of enthusiastic exhibit actors who don't need to be paid because they turn lifeless in the morning. Dr. McPhee gladly rehires Larry, who sells his company to do work that makes him happy even though it doesn't pay as well. On the same night, Larry meets a woman who resembles Amelia and speaks to her, leaving us to hope that they all live happily ever after.
*During the credits, we see a boy from the 1945 painting where Larry lost his Blackberry. He has taken apart the advanced device and is studying its technology. His mother calls him down to dinner by his full name, Joey Motorola.