The story starts in Baghdad, with Sultan Shahryar who has gone mad after he killed his first wife during a failed coup d’état which she planned with Shahryar's own brother. Now, five years later, Shahryar believes that all women want to kill him, but he must get married or the throne will pass to his brother. In his madness, Shahryar decides to take a wife and have her executed the next day. In order to prevent this, the clever Scheherazade, daughter of the Sultan's advisor Ja'Far and a childhood friend of Shahryar, who is in love with him, marries the troubled Sultan and tells him stories every night, stopping at daybreak with a cliff-hanger. In order to hear the rest of the story, Shahryar must keep Scheherazade alive until the next night. Cunningly, Scheherazade has hidden a moral within every story, to bring the Sultan out of his madness.
As Scheherazade tells her stories though, Shahryar's brother begins to build up an army to take control of the kingdom. By the time he is ready to attack, Shahryar has overcome his madness and now truly loves Scheherazade. The two lead the army into battle and Shahryar and his troops are able to stop the brother by using elements from Scheherazade's stories. At the end of the battle, it is revealed that the entire thing had actually already happened. Scheherazade was retelling the events to her children. The audience is left wondering if Queen Scheherazade had been faithfully recounting the story of her life or whether the whole tale was just a story itself, made up by Scheherazade to tell her children. She finishes the story and promises them one the next night.