Early on in the 3.5 campaign we just finished up, I had the players find a magic longsword in a dungeon. It was intelligent and telepathically introduced itself to one of the PCs, an elven ranger: its name was Malaterminus ("Slayer of Evil") and a diviner had foreseen a day when the ranger, Finoula, would be in a position to save the world; Malaterminus had been crafted to help ensure her success. As such, it could detect evil and had its own lawful good alignment shielded so detect good spells couldn't be used to find it by those who wanted to see the weapon destroyed rather than allow it to help Finoula save the world. In fact, that was why it had been placed in a hidden dungeon, at the bottom of a narrow crevasse only accessible by traversing the edge of a pool of acid: to make sure nobody else could find it and destroy it before Finoula's prophesied discovery of the longsword.
Finoula's player was ecstatic that her ranger had been prophesied to save the world and was looking forward to seeing how events played out along those lines. And sure enough, Malaterminus would often point out which creatures they encountered were irredeemably evil and use its telepathic abilities to determine when people the adventurers dealt with were lying.
Then one night, while camping out in the woods in the course of one adventure or another, the lawful good dwarven cleric NPC who had guard shift immediately before Finoula woke her up for her shift, said goodnight, and went to sleep in her blanket by the campfire. Malaterminus waited a good ten minutes until the dwarf was fast asleep, then telepathically informed Finoula of the terrible news: sometime during the last guard shift the dwarf must have been slain, for the creature pretending to be the dwarven cleric was a doppelganger. Worse yet, as it fell asleep it had been reveling in how much fun it had had slaying the dwarf and hiding her body and was even now deciding which of the party members it was going to kill the next night. They had to act now, while it was asleep and currently helpless: as it was currently wearing the shape of a dwarf, its heart would be where a dwarf's heart was; Finoula needed to kill it with one blow.
Finoula crept quietly up to the sleeping "cleric," Malaterminus telepathically helped line up her strike, and then Finoula plunged the sword into the dwarf's chest. The dwarf awoke with a startled look of betrayal on her face and died - and then Malaterminus ("Evil Slayer," not "Slayer of Evil"), an incubus demon who'd been cursed into the form of a longsword and imprisoned deep in a dungeon where it would hopefully never be discovered, resumed his true form. The curse, he told Finoula, could only be lifted if the sword was ever used by a good person slaying another of good alignment in cold blood.
Finoula's screams woke the PCs and they were able to drive the incubus off, but he came back to Finoula once again in the campaign and she made it her life's goal to hunt him down and slay him permanently for what he'd tricked her into doing. (And she did actually do just that, about halfway through the campaign. The dwarven cleric was raised and was understandably miffed at Finoula for a bit, but they made up - she actually performed the atonement spell on Finoula herself - and things went on as before until the dwarf was irrevocably slain later on fighting a demilich in the arctic.)
Oh, and in an adventure before Finoula slew the cleric and released Malaterminus, I had each PC/NPC receive a personal prophecy from a magic mirror. Finoula's was: "Beware, for the betrayal of a beloved friend is the worst kind to bear," and the dwarven cleric's was: "A wounded heart may indeed be mended over time; forgiveness is key." Nobody had any inkling of their true meaning until after Malaterminus convinced Finoula to slay her dwarven friend.
Johnathan