The Sandwraith appears in Prince of Persia: Warrior Within as a humanoid creature in some state of decay. It is wrapped in shreds of fabric that swirl in a supernatural wind, and its eyes glow a bright blue. The Prince sees it just as he enters the primary complex of the Fortress of Time, and for the first two-thirds of the game its nature is shrouded in mystery. It even appears to be hostile to the Prince, throwing an axe at him, which he only narrowly avoid; it is later revealed that it did this to stop the Prince from being killed by an enemy. Just prior to his confrontation with the Empress of Time, the Prince witnesses the apparent demise of the Wraith at the hands - or rather tentacles - of the Dahaka, which then curiously proceeds to ignore the Prince entirely.
Following his first and failed attempt to prevent the creation of the Sands of Time in the past, the Prince finds himself again on the run from the Dahaka in the present. Evading the creature, the despondent Prince finds himself in a vast crypt. Wrought with the cruel irony of his situation, he brushes his hand over a wall covered with ancient markings. Perhaps reacting to his touch, the amulet he wears, or simply coming to his attention (the cut scene doesn't make the cause clear), the markings tell a story of a member of the Maharajah's army in his raid for the Sands. While the raid appears to succeed, the man himself dies, but through an artifact called the Mask of the Wraith rewrote his Fate and escaped death. The game's manual makes reference to the Maharaja himself using the Mask to retrieve the Sands, and is depicted in the ancient markings found in the crypt. A possible error to this tale is the fact that even though the man found death, he was still somehow
able to find and use the Mask and change his fate. This may have been possible because in order to remove the Mask his past self would have had to die, which would cause anyone watching to think that he was dead.
The Prince then hunts down the Mask and puts it on, becoming the Sandwraith, a creature not only able to shift time, but to take up another space in the Timeline, separate from the Prince. Thus the Wraith sets out to stop his past self from killing Kaileena. When he reaches the Prince at last, it is at the point where the Wraith was originally killed by the Dahaka. This time, he lets the Prince die, and the Dahaka, apparently satisfied, leaves. The Mask then loosens and the Prince returns to normal and continues his journey to change the expected events in the battle against the Empress of Time.
The Sandwraith also appears as an optional costume for the Prince in The Forgotten Sands.
While wearing the Mask of the Wraith, the Prince retains his personality, memories and his fighting skills, including his mastery of various weapons. This suggests and might even prove that although the Mask has deformed his physical appearance, it is not possessed by another conscious being. As the Sandwraith, the Prince can manipulate time without limit, as his Sand Tanks fill themselves up automatically. However, the Mask depletes the Prince's lifebar even when not struck or hurt in any way. Unlike the Dark Prince, this depletion will not kill the Prince but will take his life down to one quarter of the standard health circle (life upgrades do not affect this value) if allowed the time. This implies that the Mask actually drains the essence of the person who wears it and transforms it into the Sands of Time, though this has never been confirmed.