Aladdin was a young vagabond from Agrabah, who had to steal for food, with his monkey Abu as his only friend. Aladdin fell in love with Jasmine, the princess of Agrabah, but he knew that the law only allowed her to marry a prince. The evil vizier Jafar had Aladdin retrieve an old lamp from the Cave of Wonders, intending to kill him later, but Aladdin survived thanks to Abu and a Magic Carpet living in the cave. Aladdin found a Genie in the lamp, and got three wishes, the first one being becoming a prince to be able to marry Jasmine. When Jafar eventually got his hands on the lamp, he turned Aladdin back into a "street rat" and tried to kill him, but Aladdin tricked Jafar into wishing to become a Genie, which trapped him into a new lamp. After Jafar's defeat, the Genie offered to turn Aladdin back into a prince with his third wish, but Aladdin instead used it to free the Genie. However, the Sultan of Agrabah changed the law to have Jasmine marry whoever she saw fit, and she chose Aladdin.