As Jafar is sucked into his lamp, he protests his inevitable fate and grabs Iago, sealing the two within. A piece of paper appears and falls on Sora's face. He easily recognizes it as part of Ansem's reports when Donald Duck, Goofy, and Genie congratulate him on his victory. Genie plucks Jafar's lamp out of Sora's hands and buries it in the Cave of Wonders. Sora notices the Keyhole and seals it just as the cave begins to collapse. They board Carpet, telling the others that they have to leave. Aladdin begins to refuse, but Sora informs him that Jasmine was taken to a different world. The carpet zooms off, unknowingly leaving Goofy behind. Unable to turn around, Aladdin uses his second wish to save him. Goofy thanks Aladdin as the carpet flies out of the Cave of Wonders.
Back at Aladdin's House, Donald glares at Sora, but he claims that it just slipped out of his mouth. Aladdin pleads that they take him to the other world, but Donald refuses as it would be meddling too much. Sora, Donald, and Goofy feel bad for Aladdin when Genie suggests that he use his last wish to find Jasmine. Aladdin, however, wishes for Genie's freedom, releasing him from the lamp's hold. Genie, shocked, but happy, hugs Aladdin and claims that they're best friends. Sora tells Aladdin that they'll find Jasmine. Before the trio leave, Genie hands them his lamp, explaining that while he is free from its spell, it can still be used to summon him if they need help.