In ancient times, the hero Jamshid sealed away the dark god Ahriman and established the kingdom of Shadam. Although Shadam was once conquered by Ahriman's servant, the serpent king Zahhak, it was reclaimed one thousand years later by the hero Fereydun, and Shadam finds peace and prosperity under successive kings. However, Ahriman begins to plot his return; he manipulates the Yufurat Empire, led by a descendant of Zahhak, into searching for the three holy rings that Jamshid had used to seal him away. In the present day, King Shadam VII tasks his son, the Prince, with escorting Mariam, the Princess of the neighboring kingdom Mahamoud and keeper of one of the rings. When the Yufurat Empire attacks the Shadam Kingdom, the King gives the Prince the second ring and instructs him and Mariam to escape to Mahamoud and seek aid from its king. The Prince is attacked by the traitorous General Gaddafi and awakens in the lair of a resistance group. The resistance leader informs the Prince of a magic lamp said to be hidden within the Shadam Kingdom treasury, and suggests that the power of the lamp can nullify the magic of Gaddafi's sword. The Prince obtains the treasury key from his dying tutor and discovers the lamp within the treasury. The lamp houses a powerful Jinn who declares the Prince to be his new master. Aided by the Jinn's magic, the Prince successfully defeats Gaddafi and avenges his tutor. The Prince and Mariam disembark on a ship helmed by a captain and his son Sindbad.