Dastan, a street urchin in Persia, is adopted by king Sharaman after showing courage in the marketplace. Fifteen years later, Sharaman’s brother Nizam receives proof that the holy city of Alamut is supplying weapons to Persian enemies, and the princes — Dastan, along with the king’s biological sons Tus and Garsiv — are sent to siege and take over Alamut. Dastan and his friends breach into the city on their own, and open a gate letting the Persians in. During the attack, Dastan fights a guard for Alamut’s royal family and takes from him a special dagger.
Alamut falls to the Persians, but princess Tamina denies the town having 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. During the celebration, Dastan is fooled into presenting a poisoned gown seemingly given to him by Tus to King Sharaman, which fatally burns the king. Garsiv accuses Dastan of being the murderer, and the prince is forced to escape, carrying Tamina along. Tus is appointed king and orders a manhunt on Dastan.
While in hiding, Tamina attempts to kill Dastan, and in the struggle the prince discovers the dagger enables its wielder to travel back in time. Dastan then believes that Tus invaded Alamut for the dagger, and decides to confront his brother at the funeral of the king in Avrat. On the way, the two are captured by merchant-bandits led by Sheik Amar, who recognized and attempted to take him back to Persia for the reward money, but they manage to escape. After arriving in Avrat, Dastan tries to convince his uncle Nizam that he was not the cause of his father’s death, only to discover the dagger was taken by Tamina. Instead, he notices the burns on Nizam’s hands, which indicate he was the one who set up the murder of the King. Furthermore, Nizam has set up an ambush for Dastan along the Persian streets, and after a conflict with his brother Garsiv, Dastan escapes. Nizam sends a group of covert and seemingly mystical warriors, the Hassansins, to kill Dastan and find the dagger.
During a sandstorm, Tamina tells Dastan the origins of the Sands of Time that enable the dagger’s time travel, while admitting the weapon only holds enough sand to reverse time by one minute. Dastan realizes that Nizam’s plan is to place the dagger in the sandglass holding the Sands of Time, causing Nizam to go back in time and prevent himself from saving Sharaman’s life from a lion as children so that he’ll be king of Persia. Tamina says that in doing so, the sandglass would be broken and destroy the world. After the two are captured by Sheik Amar, and Dastan saves Amar’s men from an Hassansin attack using the dagger, the Sheik is convinced to carry both to a sanctuary near India, where the dagger could be sealed by returning it to the stone it once came from. At the sanctuary, they are found by Garsiv, whom Dastan convinces of his innocence but are later ambushed by the Hassansins. Garsiv sacrifices himself to save Dastan, while Tamina is knocked unconscious by a Hassansin and the dagger is stolen.