What's with the Japanese ghost-killing swords?
What's with the Japanese ghost-killing swords? I've seen this plot device used over and over in Japanese anime, tv shows, movies, and video games - a magic sword, usually described as "cursed," usually a katana, that can "kill" ghosts. There was even a ghost-killing gun in one tv show. The last two episodes of "Xena" included a Japanese character known as the "Ghost Killer" who weilded a katana. Where does this come from? Usually when you see a particular theme being used repeatedly in Japanese media (the nine-tailed fox, the three sacred treasures, etc), it comes from their mythology or the Buddhist religion. But I can't find a thing about ghost-killing swords in any myth; everything I saw online referred to various tv shows, video games, and movies that include swords like this. It's gotta come from somewhere. Help!
Search terms I've tried: Japanese ghost killing sword, demon killing sword, ghost slaying sword, all of this with variations involving the words "ghost," "kill," "slay," "katana," and "Japanese."
Thanks for any help you can provide.