When the Prince fell into the Well of Ancestors he found the body of his father, the King of Persia, along with this sword. Taking it, the Prince resolves to face his problems head on, and live with the future he created rather than running away from it as he had done for seven years. This gives him the strength to suppress his dark form.
The sword itself is inscribed with markings that glow with a bright light, which helped the Prince to find his way into the catacombs under the palace. It is also a very powerful sword: when the Prince is wielding it, he can break walls that are already damaged and can kill any sand monster, except for the Vizier and supposedly the other bosses in one hit.
However, they will not drop any Sand if killed by the Sword except for Thralls, so the best thing is to use a combo that uses both the Dagger of Time and the King's Sword. The sword becomes a permanent secondary weapon; as such, the Prince can no longer pick up fallen weapons nor throw away the King's Sword.
During the final battle with Zurvan, the Prince, after cutting off his "wings", plunges this sword through the Vizier's chest. This horribly wounded Zurvan, but did not kill him. Zurvan flew away to attempt to heal himself, but the Prince was able to follow him and finish him off with the Dagger of Time, thus ending the Vizier's evil reign.
This sword replaces the Dagger of Time as the primary weapon in the Prince's dream battle - named 'The Mental Realm' in the game - with the Dark Prince. It can be assumed that this is the sword the Prince uses as the King of Persia, or it is also thought that the Prince had a new sword forged for himself, and buried this sword with his father. This is possible, though unlikely, since swords like these usually wind up being family heirlooms.