Spoiler warning: this article may contain major plot or ending details.
During the climax of Pokémon Sword, the player's Rusted Sword, along with Hop's Rusted Shield, summons Zacian and Zamazenta to help the two Trainers to battle against Eternamax Eternatus at the Tower Summit. The Rusted Sword temporarily becomes Zacian's held item for the duration of this battle. During the post-game, the player returns the Rusted Sword to Slumbering Weald. It is soon after temporarily stolen by Sordward, before the player defeats him in a battle and retrieves the stolen item. Before the player battles Zacian at the Tower Summit in order to catch it, they give the Rusted Sword to it as its held item.
In Pokémon Shield, the Rusted Sword is instead obtained by Hop. During the post-game, when he returns it to the altar at Slumbering Weald, it is stolen by Sordward. Hop battles Sordward, but is defeated, allowing him to get away with the item. Later, Sordward uses the Rusted Sword to lure Zacian to the Tower Summit. After the player has battled Zacian, it flees, and Hop retrieves the Rusted Sword from Sordward, before chasing after Zacian. After Hop has caught Zacian at Slumbering Weald, the Rusted Sword becomes its held item in the player's subsequent battles against him.
The Rusted Sword first appeared in a flashback in PASS05, along with the Rusted Shield. One year before the events of the Sword & Shield arc, Sōdo, accompanied by Shirudomiria, entered Slumbering Weald in order to see the two legendary artifacts. After confronting illusions of Zacian and Zamazenta at the altar at the end of the forest and convincing them they weren't trying to steal anything, the two Trainers approached the two artifacts on the altar, but were then knocked out by a bright burst of light. When they recovered, the artifacts were gone.
Trivia
The Rusted Sword does not appear as an item in the player's Bag until they have caught Zacian while it is holding it. This is likely done in order to prevent the player from removing the item from their Bag too early and contradicting the events of the game's story.
The Rusted Sword appears to feature fictional runic characters, likely a combination of both Japanese and Old Norse characters.