During a raging desert battle between the cities of Basra and Baghdad, Basran is fatally wounded. Before dying, Basran takes a medallion from his killer's neck and passes it to his son Harun, urging him to somehow end the senseless killings. Harun rides to Baghdad and meets shopkeeper Barcus. For ten dinars, he can choose any item in Barcus’ shop, and he eventually uncovers a magical golden sword tucked away under a pile of rags. The blade has power only when Harun wields it, able to cut through solid metal. Barcus warns him to be careful until they can translate the blade’s inscriptions.
In the palace, Vizier Jafar presses the Caliph to wage war on Basra, a scheme designed to stain the Caliph’s reputation. The Caliph, however, is more concerned with his rebellious daughter, Khairuzan. To tame her, Jafar suggests an arranged marriage to Hadi, the Vizier’s son. Khairuzan disguises herself as a boy and escapes the palace, briefly stealing Harun’s horse in the process. A chase ends with Harun and Khairuzan both capturing the moment, and Harun emerges victorious in their skirmish, discovering that the magical sword makes him feel invincible.
Khairuzan claims to be a boy slave, and Harun brings her to the city. Barcus reveals a crucial truth: the sword’s first inscription promises that whoever unsheathes the blade will gain the throne. Harun soon learns that Khairuzan is a girl, and when a guard questions them, he protects her as they are both thrown into the dungeon, where they share a growing tenderness and a kiss. After a tense moment, Khairuzan returns to her harem, but she publicly asserts that only the winner of a grand tournament may claim her hand. Harun, meanwhile, becomes her loyal guard, and he admires how kind she is to the poor townspeople.
Khairuzan’s handmaiden, Bakhamra, informs Hadi of the magic sword. He and Jafar cunningly drug Harun, switch the sword with a replica, and Khairuzan wakes Harun to learn why he hasn’t joined the tournament. Believing he’s not aristocratic enough to wed her, Harun is surprised by her question and the two share a kiss. He rushes to Barcus with joy, who cautions him that the second inscription foretells a grave, but Harun refuses to listen.
At the tournament, Hadi defeats Harun by cheating. Harun suspects Khairuzan of treachery after the theft of the true sword, and Bakhamra reveals the plot to him. Just as Hadi is about to lead his unwilling bride to bed, Harun confronts him and is captured by Hadi’s guards. The Caliph orders Jafar’s arrest, but Jafar unveils a medallion identical to Harun’s and tries to kill the Caliph. In the ensuing struggle, the magic sword is driven into a stone pillar, becoming stuck. The guards kill the Caliph, and Harun and Khairuzan fabricate their deaths to escape.
Jafar and Hadi soon realize they cannot pull the sword from the column and summon men from across Bagdad to assist. Khairuzan rallies the townspeople while Harun and Barcus slip back into the palace. Harun fights the guards and is nearly captured, but Khairuzan and her people storm the palace. Harun seizes the sword from the stone, and the pillar collapses on Jafar and Hadi. Khairuzan grants Harun the title Al-Rhashid, and the two seal their triumph with a kiss, beginning a new reign built on unity and justice.