jafar, the sultan's vizier, discovers that aladdin is the only one who can enter the cave of wonders and find a magic lamp. jafar orders him to get the lamp. aladdin and his pet monkey, abu, enter the cave, where they befriend a magic carpet and obtian the lamp. abu inadvertently grabs a forbidden treasure and the cave collapses itself. after surviving, aladdin rubs the lamp and meets the genie, who grants three wishes for him. aladdin uses the first one to disguise himself as a prince. he returns to the city, and meets the sultan and jafar. after jasmine deduces the identity from aladdin, the sultan decides to promote him. when jafar steals the lamp, he uses two wishes and banishes aladdin from the city. however, aladdin returns to the palace and tricks jafar into having the third wish, which makes jafar being transformed into a genie. aladdin uses the dark lamp to trap jafar inside of it.