Sora, Donald Duck, Goofy, and Aladdin are overwhelmed by the Heartless. As the group are distracted with the Heartless, Jafar places Jasmine in a Pot Spider. Aladdin notices, but the group is cut off by a Fat Bandit who breathes fire at them. Jafar leads the Pot Spider deep into the Cave of Wonders where he uses the lamp to summon Genie so he can grant his first wish: reveal the Keyhole.
A battered Sora, Donald, Goofy, and Aladdin travel through the Cave of Wonders, searching for Jafar and Jasmine. Aladdin stops Abu from taking treasure and, unsure of where to go, the group decides to follow Sora's Keyblade. The group hears a boom and wonder about what caused it.
The boom in question is the result of the recently revealed Keyhole. Jafar praises Genie and claims that the two can rule the world together when Maleficent suddenly appears, asking if Jafar is planning to set off on his own. Jafar claims that he was only kidding, but Maleficent reminds him that she can easily find a replacement. She drops the subject and instead informs him that she's taking the princess. Sora and company arrive where Aladdin demands to know about Jasmine's whereabouts. Sora spots the fairy and asks if she's Maleficent, but she doesn't answer and begins to disappear. Aladdin charges, but passes through Maleficent and the Pot Spider containing Jasmine as they disappear. He pleads for Genie to save Jasmine, but Jafar gloats that he is now Genie's master. Aladdin reaches for the lamp, but Jafar holds it above his head and uses his second wish by ordering Genie to attack the group. Aladdin tells Genie to not listen to Jafar, but he tells them that "the one with the lamp calls the shots" and shoots lightning at the group.
Genie weakly attacks the group while pleading that they get away and are careful. He shoots lighting in a random direction and electrocutes Goofy. Jafar, angered at Genie's weak attempts, decides to take matters into his own hands and commands Genie to make him "an all-powerful genie". As Jafar basks in his new power, Sora notices Iago clutching Jafar's lamp. Jafar announces that he'll begin his conquest of the universe by destroying Aladdin, Donald, and Goofy. However, Sora, having knocked out Iago, grabs Jafar's lamp and orders him back into his lamp as the "one with the lamp calls the shots".