SpongeBob and Patrick are in Jellyfish Fields blowing bubbles. Patrick tries to take pictures of the bubbles, but they keep popping before the picture is taken. SpongeBob decides to blow a bubble that would last all day. SpongeBob blows a bubble so big that it engulfs them both and carries them into a nearby cave. The bubble suddenly pops as it makes an impact with an ancient piece of gold.
Eager to discover what exactly it is, they decide to take it to the Bikini Bottom Museum where they (literally) run into Squidward. At first, Squidward thinks that SpongeBob and Patrick were planning to steal the first half of the amulet which is housed in the museum, but upon attempting to return it to its spot, he realizes that what Patrick and SpongeBob had was, in fact, the missing half. At this point, both Mr. Krabs and Sandy join them.
The pieces of gold are then reunited, which summons a luxurious bus (or 'van' as Squidward calls it) piloted by a robot and it's fueled by "song." During the song to fuel the bus, it is revealed that Plankton has stowed away in a compartment at the front of the bus and plans to control the lost weapons of Atlantis.
Once they arrive there, (accidentally crash-landing in a topiary garden) they meet the king of Atlantis, Lord Royal Highness, LRH for short, who shows them the riches, knowledge, and art of Atlantis. Meanwhile, Plankton escapes from the compartment and sneaks into the vault storing the weapons. After looking around at the weapons, he chooses to commandeer a tank (seemingly at random) to start his diabolical scheme.
Meanwhile, Mr. Krabs enjoys the money vault, Sandy enjoys the science lab, and Squidward enjoys the hall of art (the rooms each had been planning to see). In the money vault, money, gold, and prized objects are found and mostly stashed in Mr. Krabs' pants pockets. In the science lab, Sandy enjoys the devices, a biomass-converting device that turns any household object into ice cream (a bug the Atlanteans have not worked out), a germ-fighting, interactive, micro video game, and makes an automatic feeding device. In addition, in the Hall of Arts, Squidward journeys through paintings, is modeled by painters, and even makes his own painting, claiming to have learned more about art in his short time in Atlantis than he did while at college.
However, everything goes wrong when SpongeBob and Patrick are left alone with the World's Oldest Living Bubble. The flash from Patrick's camera when he takes a picture of themselves with the bubble causes it to burst and the pair goes to dinner and insist on leaving. When Patrick reveals their mistake, LRH tells them that the bubble they popped was a prop, but when he shows them the real bubble, Patrick takes a picture of it and it also pops.
LRH is furious and summons the Atlantean Royal Guards to seize the gang, but Plankton appears with a tank.
He fires the tank at SpongeBob, the gang, and the Atlantean Royal Guards, but is foiled when it is revealed that the weapon he had chosen only shoots ice cream. He jumps out of the tank and in frustration, kicks it, injuring himself. However, LRH seems delighted, saying, "This talking speck will make a fantastic replacement for our recently deflated national treasure!"
Finally, LRH loads SpongeBob and his friends back onto the bus and removes the amulet, giving it to one of his soldiers to dispose of to ensure no more "visitors like these." SpongeBob is the only one eager to return to Bikini Bottom and sings. His friends (including his best friend Patrick, his boss Mr. Krabs, Sandy, and even his grumpy neighbor Squidward) get sad throughout the song. Squidward, Sandy, Mr. Krabs and Patrick start crying near the end of the song, but SpongeBob ignores and sings all along.