The Thief of Bagdad is an epic silent movie masterpiece, that was the basis for the plot in Disney's Aladdin.
It is included on the American Film Institute's list of top 100 movies, and is on their list of top 10 fantasy movies.

The Thief of Bagdad
(1924)

The thief (Douglas Fairbanks) lives on the streets of baghdad. He sees the princess in a procession through the city, and immediately falls in love with her. Her father, the caliph, has decreed that she must choose a husband by her birthday. The mongol prince (the Jafar character from Aladdin) wants to win her, to get control of the city. The thief steals clothes and a horse and presents himself as the prince of a far off land. The princess trusts in an old soothsayer, who tells her that she should marry the one who touches her rose bush in the garden. The mongol prince has been told of of this by a mongol servant of the princess who spies for him. When the mongol prince goes to touch the rose bush a bee stings him, and he does not actually touch it. Just then, the inexperienced thief falls off his horse landing right on the rose bush.

The mongol prince realizes he is losing to the thief, and has the thief exposed. The thief is flogged and thrown out of the city. A holy man takes pity on the thief and show him a cavern with a magic box. The thief makes it through the sea of fire, past dragons etc.. to get it. When you make a wish and sprinkle dust from the box your wish comes true (no genie in this version).

The mongol prince has his army snuck into the city as porters. He has his spy poison the princess. With his magic, he brings her back to life, so that he will be the one to marry her. At the same time, his army is taking over the city. The thief makes his own army with the magic box and defeats the mongol prince. He marries the princess, and they take off on a magic carpet ride.

Thanks Joseph C!