Genie reaches the City of Zahrah (named for Princess Zahrah's great great great grandmother), but is left in a nearby oasis so as not to startle the populace. Inside, they find the 40 Thieves living it up and a wanted poster for Zahrah. Zahrah tries confronting Zayid, but Ace and Rex tackle him when he tries to grab her and they escape. Zayid sends the bandits to find the kids and the Alpha Trio to fetch his laundry, but Ursula barges in on the D-Team upon hearing "old lady". She tearfully explains how they were forced to serve the Thieves, who now control the city with Rasheed, the Sultan and Dr. Z being locked in the dungeon. They suggest handing over Zahrah might give them access to the dungeon for a rescue, but Rex shuts them down and accidentally reveals his crush. As the Trio leaves, however, they're stopped by Zayid, but claim the princess ran in the opposite direction to her hiding place. On the Space Pirate Ship, Spectre is singing to Brontikens, when Genie spits out the Red Cosmos Stone, the Detector finding it, but Genie swallows it again, the signal vanishing.
Shear searches the Stone's prior location, only finding sand and more sand, Spectre smashing the Detector in frustration; Shear decides to find and follow the D-Team, expecting them to stumble upon the Stone for her. Dr. Ancient is brought before Spectre, but he'll forgive the parents' failed escape if he fixes the Detector—what happened to it isn't important. Spying in on the city, Max's suggestion to take some guards' outfits and sneak in is rejected, Zahrah suggesting they use a secret underground entrance to the palace, but she doesn't know where it is. With everyone getting hungry, the boys realize Zoe is acting weird, making her reveal she'd taken a few things from the Thieves' treasure cave they can buy food with. On their way back, however, they spot someone selling magic genie lamps, but after the show realize it's a scam with a fake genie; as Max confronts them, a bandit guard spots Zahrah and a group of them move in. When one of them pulls off Zahrah's hood, the lamp seller falls in love on sight.
The bandits close in, but scatter when Chomp is summoned. The lamp seller brings the group to his run-down abode; Rex is suspicious of him, Max says Rex is just jealous, Zoe throws the same back on Max, and Zahrah ends all their arguing. The seller overhears about the secret passage, saying he's seen the Thieves using it and will take them there, just wanting to help a pretty girl. Meanwhile, Rasheed bemoans the continued failure of capturing Zahrah, needing to marry her and become royalty for the people to accept his rule. The seller brings them to the passage, but the Thieves surround them, paying the reward to the seller's fake genie partner who led them here. Suddenly Shear arrives, after the Cosmos Stone Zahrah might know about, and summons Lexovisaurus, but the D-Team's dinosaurs keep her away from Zahrah and defeat and reclaim her dinosaur.
While Zoe is annoyed Rex was more worried about Zahrah than her, Max comes over, but Shear erupts from the sand behind him and sends her razor boomerang at him…
D-Team vs. Shear/Lexovisaurus
Shear summons Lexovisaurus to scatter the bandits, Max summoning Chomp. Shear grabs Zahrah, Rex summoning Ace to force Shear away. Zoe leads Zahrah away, but they're stopped by Zayid; Zoe summons Paris to scare him off. Lexovisaurus tries cutting the trio off, Chomp interfering; it upgrades to Spectral Armor Lexovisaurus, ramming a charging Chomp flying into the passage's entrance and defeating him, the entrance collapsing.
Lexovisaurus uses Sand Trap to stop Paris, Zoe, and Zahrah, but Ace upgrades to his DinoTector form and uses Hurricane Beat, destroying Lexovisaurus' Spectral Armor and defeating it, Sand Trap vanishing. Rex presumably reclaims its card.
-Ursula: "I'm sure if we handed the princess over to him, he'd give us a promotion, then we could save Dr. Z."
-Max: "You want us to let you take the princess!?"
-Rex: "You gotta be kidding! That's not gonna happen, I promised to protect her and I am gonna keep that crush on her!"
-Zahrah: "That what?"
-Rex: "I mean…uh…"
-Ed: "Well this just got awkward."
-Zander: "Funny, I always thought Rex had a crush on you."
-Zoe: "On me? Don't be ridiculous, that's crazy."
(Shear is flying a Pod Ship across the Persian desert, communicating with Spectre on the main ship)
-Spectre: "What do you see now?"
-Spectre: "Okay, what about now?"
-Shear: "Uhg. More sand."
-Spectre: "And, uh, now?"
-Shear: "Pretty much the same sand, and then more sand, and then more sand after that."
-Spectre: "I want that Cosmos Stone, and I want it now, Shear."
-Shear: "The coordinates you sent me cover an entire desert. Can't the new radar we have get any more specific?"
-Spectre: "Rraah! You worthless piece of worthlessness! Gah!" (punches a hole in the Cosmos Stone Detector)
(Dr. Z and the Sultan are being held in the dungeon in adjoining cells)
-Sultan: "If I don't get out of this awful place soon, I'll go stark raving mad."
-Dr. Z: "Listen up! If you guards don't let me out at once, you'll regret it—I'll unleash a plague of dinosaurs on you that will smash you to little tiny pieceeees!"
-Sultan: "Sounds like that poor little man in the next cell has already gone stark raving mad."
(Shear summons her Lexovisaurus in midair, and it drops to the ground amongst the Thieves)
-Thief: "Why do monsters keep falling from the sky?!"
- The Japanese title is a pun on the folk tale Aladdin and the Magic Lamp.
- The old Hulu version of this episode lacked the "Wanted" written atop all of Zahrah's posters that the 4Kids YouTube version has, a rare instance of missing English text still occurring in season 2 for the Hulu uploads.
- Despite debuting in this episode, Aladdin's name isn't spoken in the English dub until the beginning of next episode.
- This episode features another very rare season 2 summoning transformation sequence, again for Chomp (for his first summon).
- This is the first season 2 episode in which Chomp was defeated, but considering Chomp's strength, this was unusually easy as Lexovisaurus defeated him with just one physical hit. This was probably a poorly planned way of making Rex look like a hero, although it is also possible that Lexovisaurus was simply unusually strong.
- As of this episode, each of the D-Team's main dinosaurs has defeated a stegosaur. Interestingly, all three stegosaurs that appeared in the anime were defeated by a different D-Team main dinosaur: Chomp defeated Stegosaurus, Paris defeated Tuojiangosaurus, and Ace defeated Lexovisaurus.
- This is one of the few times that one of the Space Pirates (Shear) apparently tries to directly kill one of the main protagonists (Max), making Shear out to be one of the most vicious villains in Dinosaur King, though it's revealed next episode she didn't care if she missed, it was merely a distraction.