"Unusual Swords" appeared in the Advanced Dungeons & Dragons Dungeon Master's Guide back in 1979. They featured Intelligence, alignment, speech, rarely telepathy, and a host of special powers. All such weapons possessed an Ego rating, and if the Ego + Intelligence of a weapon exceeded the Intelligence + Charisma + Level of a character wielding it, the weapon would sometimes dominate the user, allowing the sword to execute its Special Purpose. An earlier version of Dungeons and Dragons may feature such weapons, but I lack the books to verify this.
Living weapons make their appearance in literature far earlier. Many readers encounter their first living weapon in the form of Stormbringer, a rather sinister sword first created by Michael Moorcock back in 1961. The oldest living weapon I could track down is Sharur, the "Smasher of Thousands", an enchanted living mace wielded by the Sumerian god Ninurta circa 1000 BCE.
As you can see, the concept has a rather long and storied history.