Lady of the Lake is the name of the ruler of Avalon in the Arthurian legend. She plays a pivotal role in many stories, including giving King Arthur his sword Excalibur, enchanting Merlin, and raising Lancelot after the death of his father. Different writers and copyists give the Arthurian character the name Nimue, Viviane, Vivien, Elaine, Morgaine,Ninianne, Nivian, Nyneve, or Evienne, among other variations.
The Lancelot-Grail Cycle provides a backstory for the Lady of the Lake, Viviane, in the prose Merlin section, which takes place before the Lancelot Proper, though it was written later. She refuses to give him her love until he has taught her all his secrets, after which she uses her power to trap him either in the trunk of a tree or beneath a stone, depending on the story and author. Though Merlin, through his power of foresight knows beforehand that this will happen, he is unable to counteract Viviane because of the "truth" this ability of foresight holds. He decides to do nothing for his situation other than to continue to teach her his secrets until she takes the opportunity to entrap and entomb him in a tree, a stone or a cave.
The Post-Vulgate Cycle's second Lady of the Lake is called Ninianne, and her story is nearly identical to the one in the Lancelot-Grail, though it adds her bestowal of the magic sword Excalibur to Arthur. Sir Thomas Malory also uses both Ladies of the Lake in his Le Morte d'Arthur; he leaves the first one unnamed and calls the second one Nimue. Malory's original Lady is presented as an early benefactor of King Arthur who grants him Excalibur when his original sword is damaged. She is later beheaded by Sir Balin as a result of a kin feud between them (she blames him for the death of her brother and he blames her for the death of his mother) and a dispute over an enchanted sword.
According to the Vulgate Merlin, it was the goddess Diana's enchantment, given to Dyonas, that caused Viviane to be so alluring to Merlin. The Vulgate Lancelot tells us that she was the Queen of Sicily, but considered a goddess by her subjects. The continuation post-vulgata Merlin describes how she killed her lover to be with another man, but then she was beheaded by this man to be a murderess. This story was later transferred to a lake in France, and was later called the Lake of Diana.