The T.U.F.F.C.A.T.S. had saved Never Land from Zelton's Cannonbot and went off to Agrabah for the next Celestial Clash of Secrets being held there
Somewhere in Agrabah. Jafar, Grand Vizier to the Sultan of the fictional kingdom of Agrabah, is attempting to retrieve a magical oil lamp containing a genie from the Cave of Wonders. After seeing a petty thief's failed attempt to enter the cave, he and his talking parrot, Iago, learn that only a "Diamond in the Rough" can enter the cave, or anyone accompanied by him.
Jasmine, the Sultan's daughter, frustrated with "having her life lived for her" and the obligation of royal marriage to a prince, escapes the palace and goes to Agrabah's marketplace in disguise. There she meets street rat Aladdin and his monkey, Abu. The two discover they have a lot in common. When Aladdin is captured and jailed for thievery (The T.U.F.F.C.A.T.S. used stunt double jutsu to escape), Jasmine orders him released, but Jafar lies to her, telling her Aladdin has already been executed.
Jafar, disguised as an elderly man, releases Aladdin from prison and leads him to the Cave of Wonders. The tiger-shaped head of the cave tells him to touch nothing but the lamp. Aladdin enters the cave and encounters a magic carpet which guides him to the lamp. Abu tries to steal a ruby, which brings upon them the wrath of the Cave of Wonders, but the carpet flies them to the entrance. Jafar tries to kill Aladdin after getting the lamp, but Abu bites Jafar and gets the lamp back. Abu, the carpet and Aladdin fall back into the cave just as it closes. Jafar beams at finally getting the lamp; however, he cries out in agony when he realizes he does not have it.
When Aladdin awakens, Abu reveals that he sneakily took the lamp from Jafar. While trying to read an inscription on the lamp, Aladdin rubs it, unleashing the Genie, who reveals he will grant Aladdin three wishes—with the exception of killing anyone, making anyone fall in love, or bringing back the dead. Aladdin dupes Genie into freeing them from the cave without using a wish. While contemplating his wishes, Aladdin asks for Genie's opinion. Genie admits he would wish for freedom, since he is a prisoner to his lamp. Aladdin promises to free the Genie for his last wish. He then tells Genie about Jasmine, and knows that the only way to be noticed by her is if he is a prince. For his first wish, Aladdin asks to become a prince so he can woo Jasmine.
Jafar laments his failure to get the lamp but, thanks to Iago, decides to trick the Sultan into arranging a marriage between himself and Jasmine, plotting to kill both the princess and her father once he has done so. His plans are interrupted when Aladdin parades into the Sultan's palace as "Prince Ali". Jasmine rejects Ali, considering him a spoiled buffoon like all the other suitors before him. That night, Genie advises Aladdin to tell the princess who he really is, but Aladdin decides to remain the suave prince. He meets Jasmine, and after some convincing, takes her around the world on the magic carpet. During a fireworks show in China, Jasmine recognizes Ali as the boy from the marketplace. She demands the truth from him, but Aladdin instead fabricates a story that he sometimes dresses as a commoner to escape palace life. Aladdin returns her home and they kiss.
After parting with Jasmine, Aladdin is captured by Jafar (And the T.U.F.F.C.A.T.S., but was discovered to eing Stunt Double Jutsu AGAIN) and thrown into the ocean. But the Genie rescues Aladdin as his second wish. Meanwhile, Dave was able to win yet again so that he can pay the bag of money to the Sultan so he can help Al repay to make it up for Jasmine after being called a freak. Aladdin returns to the palace, revealing Jafar's plot to Jasmine and the Sultan. Jafar, however, notices the lamp in Aladdin's possession, realizes who Aladdin truly is, and escapes from the Sultan's bodyguards. Aladdin then faces a moral dilemma. Jasmine has fallen in love with Ali, not Aladdin, and if she ever finds out who he really is, he fears he will lose her. Much to Genie's chagrin, Aladdin decides he cannot use his third wish to free Genie, driving a wedge between the two. Iago, on Jafar's orders, steals Genie's lamp and brings it to Jafar, who becomes Genie's new master and uses his first wish to become Sultan. When Jasmine and the Sultan refuse to bow to him, Jafar uses his second wish to become the most powerful sorcerer in the world, using his new powers not only to force them to bow, but also to expose Aladdin as a street rat, then to send him and his friends to "the ends of the Earth."
Banished to a frozen wasteland, Aladdin uses the magic carpet to return to Agrabah, where Jafar has imprisoned both Jasmine and the Sultan as his slaves. Jasmine distracts Jafar with a seductive act as Aladdin tries to steal back the lamp, but Jafar notices and attacks him. He imprisons Jasmine in a large hourglass and turns himself into an enormous cobra. Dave used Stunt Double Jutsu and freed his friends. Jafar tries to imprison them, but Dave's crystal deflect his attack and turned Toadborg into a can, as Dave thinks that this is time to get serious as he yells "GO-REI KNIGHT!" They used Go-rei Knight to fight Jafar and Diskbot until Aladdin tries to save Jasmine from suffocating in the building sand, and Jafar traps him in hs coils. Jafar boasts that he is "the most powerful being on Earth", which causes Aladdin to shout out that Genie is more powerful. Faced with this realization, Jafar uses his final wish to become an 'all-powerful genie,' but is then surprised when after Aladdin rescues Jasmine, he reminds him that genies are not free entities as he is sucked into his new black lamp, dragging Iago with him. Genie flicks the lamp across the desert and into the Cave of Wonders.
Jasmine realizes that Aladdin played the role of a prince for her because of the law. Genie suggests that Aladdin use his final wish to become a prince again, but realizing that he cannot keep pretending to be something he is not, Aladdin decides to keep his promise and wish for Genie's freedom, much to Genie's surprise and happiness. Seeing Jasmine's love for Aladdin, the Sultan changes the law to allow her to marry whomever she deems worthy. The newly free Genie leaves to explore the world while Aladdin and Jasmine celebrate their engagement.