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.