King Sabut has a great love of science. Three wise men bring him three presents - a trumpet that will kill anyone who tries to take over, a peacock that sits in a basin of silver and cries, and an ebony horse that can take its rider anywhere. Sabut plans to give his three daughters to the wise men in marriage, but one overhears and is unhappy at having to marry an ugly old man. Her brother, Kamar al-Akmar, intervenes and winds up mounting the ebony horse. However, he doesn't know how to come down, and disappears into the sky. The creator is thrown into jail.

Kamar eventually realizes how to come back down and lands on a palace, where he wanders until he meets the lovely Princess Shams al-Nahar. When discovered, he threatens the King and then the next day flees from the battlefield on his horse. He returns later for the princess, but leaves her for a moment in his garden and she vanishes. He suspects that the wise man who created the horse took her, and he is correct. The Sage tricked Shams into climbing onto the horse with him and then flew to Greece with her, where they were captured. The sage was thrown into prison and Shams was taken to the palace.

Kamar arrives and hears that Shams is thought to be mad and the ebony horse is in the treasury. The sage has repented. Kamar goes to the palace and claims to be a man of medicine. He claims to need the horse and the princess, and then all three fly away. Back home, King Sabut has the horse destroyed, and everyone lives happily.