According to the Poetic Edda, the spear was fashioned by the Dwarves; Loki discovers the Spear whilst visiting the Dwarves (on an errand to commission golden hair for Sif). Loki flatters the Dwarves and asks the Spear of them, which they give him. In the Poetic Edda poem Völuspá, the Æsir-Vanir War is described as officially starting when Odin throws a spear over the heads of an assembly of Vanir gods. Whether or not this was specifically Gungnir is, however, unstated. In Sigrdrífumál, the valkyrie Sigrdrífa advises Sigurd on the magical application of runes. She gives Sigurd advice and shares with him lore, including that runes were carved on the tip of Gungnir.
According to chapter 51 of the Prose Edda book, Gylfaginning, Odin will ride in front of the Einherjar while advancing on to the battle field at Ragnarök wearing a gold helmet, an impressive cloak of mail and carrying Gungnir. He will then attack the wolf Fenrir with it.
In Skáldskaparmál, more information regarding the spear is presented. The spear was fashioned by the dwarves known as the Sons of Ivaldi under the mastery of the blacksmith dwarf Dvalin. The spear was obtained from the dwarves by Loki, the result of a scheme he concocted as a partial reparation for his cutting of the goddess Sif's hair. The spear is described as being so well balanced that it could strike any target, no matter the skill or strength of the wielder.
In the Ring of the Nibelung
In Wagner's opera cycle, Der Ring des Nibelungen, Wotan's (Odin's) spear is made from the wood of the world tree Yggdrasil and engraved with the contracts from which Wotan's power derives. He uses the spear to break the sword of Siegmund, leading to Siegmund's death. When he tries to bar the eponymous hero of the opera, Siegfried (Siegmund's son), from awakening Brünnhilde from her magic sleep, Siegfried breaks the spear in two and Wotan flees. It is implied that this is also the end of Wotan's power and he never appears onstage again.