In this third film of the 'Night at the Museum', the opening scene is in Egypt, 1938. A team of archaeologists are digging into a tomb to look for a valuable artefact. A young boy falls through a hole that leads his father and the others to what they came for - the Tablet of Ahkmenrah. Several local men see the Tablet and say "The end will come". The Tablet is later kept hidden for centuries.
We move to the present day in New York City where a big event is going on at the Museum of Natural History. Larry Daley (Ben Stiller) is overseeing the event while Dr. McPhee (Ricky Gervais) is in attendance. Larry gathers the favorite exhibits, including Teddy Roosevelt (Robin Williams), Attila The Hun (Patrick Gallagher), Sacajawea (Mizuo Peck), Dexter the monkey, and Rexy the T-Rex skeleton. Elsewhere, Jedediah (Owen Wilson) and Octavius (Steve Coogan) are watching a funny cat video on YouTube. Larry even meets a caveman named Laa (also Ben Stiller in a dual role), who was modeled to look like Larry as a joke.
What nobody notices is that the Tablet is starting to corrode, causing all the exhibits to act wild and cause chaos during the event. The exhibits attack guests and rum amok all over the place. Dexter slaps Larry a few times. Everyone later calms down, uncertain of what happened until they look at the Tablet and notice the corrosion.
Larry goes home to find his son Nicky (Skyler Gisondo) throwing a party where he's acting as the DJ. Larry sends all the kids out. Now that Nick's done with high school, he has pursued other interests and is looking to become a DJ full time. It's also clear that the relationship with his father has strained a bit.
On his quest to find answers, Larry discovers a picture of the boy and his father during the expedition. He learns that the boy is C.J. Fredericks, better known to Larry as Cecil Fredericks (Dick Van Dyke), the former museum security guard that tried to steal the Tablet for himself. Larry finds Cecil in a retirement home along with his elderly cohorts Gus (Mickey Rooney) and Reginald (Bill Cobbs). Larry explains to Cecil what's happening, and he recalls hearing "The end will come". He suggests that they find Ahkmenrah's parents, who are all the way in the British Museum of Natural History. Larry later goes to McPhee, who is in the process of being fired, and convinces him to call the British Museum and allow Larry to travel there with Ahkmenrah. McPhee gets on the phone and makes it happen.
Larry and Nick travel to London to get to the British Museum. They meet the security guard of that museum, Tilly (Rebel Wilson), an obese but cheerful young lady who is eccentric and thinks being an American security guard would be cooler than where she's at. When Larry gets into the museum, he sees that Laa, Teddy, Sacajawea, Attila, Dexter, Jed, and Octavius all sneaked into the crate to join in the adventure. Since the Tablet now brings the British exhibits to life, the gang first encounters a triceratops skeleton that chases after them. They are saved by Sir Lancelot (Dan Stevens), who punches the triceratops in the nose. Unfortunately, the gang has also lost Jed and Octavius, who have fallen through the ventilation chambers.
The gang goes off to find Jed and Octavius, when they come across a multi-headed snake exhibit that comes to life and attacks. Meanwhile, Jed and Octavius land on a Pompeii exhibit just as it erupts. The gang fights off the snake monster while Dexter finds Jed and Octavius. Larry defeats the snake with a defibrillator while Dexter pees on the lava to save Jed and Octavius.
The gang finds the tombs of Ahkmenrah's parents, Merenkahre (Ben Kingsley) and Shepseheret (Anjali Jay). Merenkahre is at first hesitant to reveal the truth behind the Tablet, but he eventually admits that it was a gift made for his son when he was a baby. It needs moonlight to retain its magic. Then, Lancelot reveals his true intention to steal the Tablet as he holds Nick with a knife to his neck. Larry surrenders the Tablet, and Lancelot runs off with it to find Guinevere (King Arthur's lady) and win her over. The Tablet continues to corrode, causing Teddy's arms to freeze up and Ahkmenrah to age.
The gang races to find Lancelot, but are cornered by lion statues. Larry distracts them with a flashlight like in the cat video. Tilly then locks Larry and Laa in the security room. There, Larry starts to think about his relationship with Nick. Laa points to his head and Larry thinks he means he needs to open his mind to Nick's interests, but Laa just smashes the glass with his head and breaks Larry out.
Lancelot has made his way to a local theater showing a Camelot production starring Hugh Jackman as King Arthur and Alice Eve as Guinevere. The knight runs onstage with the Tablet and tries to convince Alice to join him, though she insists that she's just an actress. Larry and the gang catch up to them and chase Lancelot to the roof where he takes a torch and the Tablet. Larry follows him (after telling Hugh how amazing he is) and corners Lancelot on the roof. However, the Tablet's magic is now almost completely gone. Teddy, Sacajawea, Ahkmenrah, Dexter, Jed and Octavius all freeze up. Larry convinces Lancelot (whose nose has melted a bit because of the torch) to give him back to Tablet to save his friends. He lets the moonlight hit it, restoring the Tablet's golden look and bringing everyone back to life.
Larry returns the Tablet to Merenkahre and decides that it and Ahkmenrah should stay there at the British Museum. The other exhibits decide to go back with Larry, knowing that even though they won't come back to life anymore, they'll still have had their adventures with Larry. Larry returns to New York and bonds with Nick.
Three years later, a British History event is happening at the Museum of Natural History. Tilly shows up to McPhee's office with a box. McPhee says that Larry left the museum and went on to become a teacher. Tilly opens the box and takes out the Tablet. She brings McPhee to show all the exhibits come to life, including some new light displays. McPhee has a big smile on his face as the exhibits play music and party together. Outside, Larry watches and smiles.