Plot
Dastan, a street urchin in Persia, is adopted by King Sharaman after showing courage. Fifteen years later at the Persian borderlands outside the Holy City of Alamut, the king's brother Nizam relays evidence to the princes—Dastan, along with the king's biological sons Tus and Garsiv—that weapons have been forged by Persia's enemies. Tus directs the Persian army to capture Alamut. During the attack, Dastan defeats a royal guard and obtains a sacred dagger from him.
Alamut falls to the Persians, but Tamina, the Princess of Alamut, denies that the city has any weapon forges. Tus asks her to marry him to unite the two nations, and she only accepts after seeing the dagger in Dastan's possession. At their celebratory banquet, Tus has Dastan give their father an embroidered robe. However, the robe is poisoned, fatally burning Sharaman. Garsiv accuses Dastan of the king's murder. Dastan escapes with Tamina, and Tus is appointed king and a bounty on Dastan's head is set.
While in hiding, Tamina attempts to kill Dastan and steal the dagger, and in the struggle, Dastan discovers the dagger enables the wielder to travel back in time. Believing Tus invaded Alamut for the dagger, Dastan decides to confront his brother. On the way, the two are captured by merchant-bandits led by Sheik Amar who seeks the reward money, but they manage to escape. After arriving in Avrat, Dastan tries to convince Nizam of his innocence. Seeing burns on Nizam's hands, Dastan realizes that Nizam orchestrated the king's murder. Dastan is forced to escape once again. Nizam sends a group of covert warriors, the Hassansins, to kill Dastan and find the dagger.
Tamina later tells Dastan that long ago, the gods unleashed a great sandstorm to destroy humanity but were moved by a young girl's offer to sacrifice herself in humanity's place and trapped the Sands of Time in a large sandglass. Tamina is the latest guardian of the dagger, given to the young girl by the gods, which can pierce the sandglass and potentially destroy the world. Nizam intends to travel back to his childhood, prevent himself from saving Sharaman from a lion attack and become King of Persia in his place. Amar captures the two again, but Dastan saves Amar's men from a Hassansin attack using the dagger. This convinces Amar to escort them to a sanctuary near the Hindu Kush, where Tamina will seal the dagger within the stone it first came from. At the sanctuary, Garsiv appears, whom Dastan convinces of his innocence. However, the Hassansins ambush them, killing Garsiv and stealing the dagger.
Dastan's group travels back to Alamut to steal back the dagger and warn Tus of Nizam. Amar's right-hand man, Seso, dies retrieving the dagger for Dastan, who demonstrates its powers to Tus and convinces him of the truth. Nizam interrupts them, kills Tus, and takes the dagger back. Tamina saves Dastan from being killed, and the two head for the secret tunnels beneath the city that lead to the sandglass. They reach Nizam, who stabs Dastan and throws them off a cliff. Tamina sacrifices herself, releasing Dastan's hand and falling to her death. This allows him to fight Nizam.
Nizam thrusts the dagger into the column of sandglass under the temple. Dastan grabs hold of the hilt of the dagger together with Nizam; as sand is released from the sandglass, time rewinds to the moment Dastan finds the dagger. He finds Tus and Garsiv and exposes Nizam's treachery. Nizam tries to kill Dastan, who easily defeats him. Nizam gets up and attempts to attack again but is subdued and killed by Tus. Tus apologizes to Tamina for the siege and proposes to strengthen the two nations' bond by marital alliance of the princess to Dastan. Dastan returns the dagger to Tamina as an engagement gift and tells her he looks forward to their future together.