Aladdin's second wish is used when the Genie rescues him from sleeping with the fishes. Aladdin confronts Jafar, and breaks his staff to free the Sultan from his spell. The Sultan is about to arrest Jafar when he escapes - but notices the lamp on Aladdin before he disappears.
Aladdin has it all - the heart of the Princess, wealth, fame, all his wishes come true - but he won't free the Genie as he still needs him around. He gets into a fight with his friends, but knows that they are right and he must tell Jasmine everything. Just then he hears her voice calling for him - but it's a trap.
Iago steals the lamp, and returns it to Jafar.
Jafar summons the Genie. First he wishes to be Sultan, then to be the most powerful sorcerer in the world. Aladdin tries to stop him but is captured and his secret is out. In a little song and dance Jafar tells Jasmine that Prince Ali is really just Aladdin, the street rat. Aladdin is sent packing in one of the palace towers to somewhere snowy (Russia??) with Abu. The carpet manages to tag along, and he brings them back in no time.
Aladdin returns to the palace. Jafar asks the Genie to make Jasmine fall in love with him - but it's against the Genie's rules. Jasmine distracts Jafar, enticing him and pretending to be under the Genie's spell, allowing Aladdin to get closer to the lamp.
Jafar sees him just in time - he transforms Abu into a toy, unravels the carpet, and turns himself into a giant Cobra and is about to finish off Aladdin, when Aladdin has an idea.
He teases Jafar - telling him that the Genie still has more power. Jafar knows it's true. He wishes to be an all powerful Genie. The wish is granted. Jafar changes ... and then Aladdin locks him into a lamp. Jafar drags Iago down with him.
All the spells are broken. The Genie pitches the lamp into The Cave of Wonders. Aladdin and Jasmine are still in love. The Genie is ready to grant little buddy Al his final wish to be a prince again, but Aladdin knows he must do the right thing. He wishes his friend free. The chains on the Genie's arms are broken and he flies around happy.
The Sultan changes the law so that Jasmine doesn't need to marry a Prince. Everyone is happy. The Genie gets ready to visit Disneyland.