Ahmed robs as he pleases in the city of Bagdad. Wandering into a mosque, he tells the holy man he disdains his religion; his philosophy is, "What I want, I take." That night, he sneaks into the palace of the caliph using a magic rope he stole during ritual prayers. All thoughts of plunder are forgotten when he sees the sleeping princess, the caliph's daughter. The princess's Mongol slave discovers him and alerts the guards, but he manages to get away. When his evil associate reminds the disconsolate Ahmed that a bygone thief once stole another princess during the reign of Haroun al-Rashid, Ahmed sets out to do the same. The next day is the princess's birthday, and three princes arrive, seeking her hand in marriage (and the future inheritance of the city). Another of the princess's slaves foretells that she will marry he who first touches a rose-tree in her garden. The princess watches anxiously as first the glowering Prince of the Indies, then the obese Prince of Persia (an uncredited Mathilde Comont), and finally the Prince of the Mongols (Sojin) pass by the rose-tree. The mere sight of the Mongol fills the princess with fear, but when Ahmed appears (disguised in stolen garments as a suitor), she is delighted. The Mongol slave tells her countryman of the prophesy, but before he can touch the rose-tree, Ahmed's startled horse tosses its rider into it. That night, following ancient custom, the princess chooses Ahmed for her husband. However, having turned from evil because of his love for her, Ahmed gives up his plan to abduct her and confesses all to her in private. The Mongol prince learns from his spy, the princess's Mongol slave, that Ahmed is a common thief and informs the caliph. Ahmed is lashed mercilessly, and the caliph orders he be thrown to a giant ape to be torn apart, but the princess has the guards bribed to let him go. When the caliph insists she select another husband, her loyal slave advises her to delay. She asks that the princes each bring her a gift after "seven moons"; the one who gives her the rarest will marry her. In despair, Ahmed turns to the holy man. He tells the thief to become a prince, revealing to him the peril-fraught path to a great treasure. The Prince of the Indies obtains a magic crystal ball from the eye of a giant idol, which shows whatever he wants to see, while the Persian prince buys a flying carpet. The Mongol prince leaves behind his henchman, telling him to organize the soldiers he will send to Bagdad disguised as porters. (The potentate has sought all along to take the city; the beautiful princess is only an added incentive.) After he lays his hands on a magic apple which has the power to cure anything, even death, he sends word to the Mongol slave to poison the princess. After many adventures, Ahmed gains a cloak of invisibility and a small chest of magic powder which turns into whatever he wishes when he sprinkles it. He races back to the city. The three princes meet as agreed at a caravansary before returning to Bagdad. The Mongol asks the Indian to check whether the princess has waited for them. They discover that she is near death, and ride the flying carpet to reach her. Then the Mongol uses the apple to cure her. Her loyal slave shows her Ahmed in the crystal ball, so the princess convinces her father to deliberate carefully on which gift is the most rare. The Mongol prince chooses not to wait, unleashing his secret army that night and capturing Bagdad. Ahmed arrives at the city gate, shut and manned by Mongols. When he conjures up a large army with his powder, the Mongol soldiers flee. The Mongol prince is about to have one of his men kill him when the Mongol slave suggests he escape with the princess on the flying carpet. Ahmed liberates the city and rescues the princess, using his cloak of invisibility to get through the Mongols guarding their prince. In gratitude, the caliph gives his daughter to him in marriage.