Tyrfing, Tirfing or Tyrving (The name is of uncertain origin, possibly connected to the Terwingi) was a magic sword in Norse mythology, which features in the Tyrfing Cycle, which includes a poem from the Poetic Edda called Hervararkviða, and the Hervarar saga. The name is also used in the saga to denote the Goths. The form Tervingi was actually recorded by Roman sources in the 4th century.
Svafrlami was the king of Gardariki, and Odin's grandson. He managed to trap the dwarves Dvalinn and Durinn when they had left the rock where they dwelt. Then he forced them to forge a sword with a golden hilt that would never miss a stroke, would never rust and would cut through stone and iron as easily as through clothes.
The dwarves made the sword, and it shone and gleamed like fire. However, in revenge they cursed it so that it would kill a man every time it was drawn and that it would be the cause of three great evils. They finally cursed it so that it would also kill Svafrlami himself.
When Svafrlami heard the curses he tried to slay Dvalinn, but the dwarf disappeared into the rock and the sword was driven deep into it, though missing its intended victim.
Svafrlami was killed by the berserker Arngrim, who took the sword in his turn. After Arngrim, it was worn by Angantyr and his eleven brothers. They were all slain at Samsø, by the Swedish champion Hjalmar, and his Norwegian sworn brother Orvar-Odd; but Hjalmar, being wounded by Tyrfing (its first evil deed), has only time to sing his death-song before he dies, and asks Orvar-Odd to bring his body to his beloved Ingeborg, daughter of Yngvi at Uppsala.
Angantyr's daughter, Hervor (by his wife Tófa) was brought up as a bond-servant and remained ignorant of her parentage. Upon learning it, she armed herself as a shieldmaiden, and travelled to Munarvoe in Samsø in an attempt to recover her father's weapon. She found it and married King Gudmund's son, Höfund. Together they had two sons, Heidrek and Angantyr (the second). Hervor gave Heidrek the sword Tyrfing in secret. While Angantyr and Heidrek walked, Heidrek showed Angantyr the sword. Since he had unsheathed it, the curse the dwarves had put on the sword made Heidrek kill his brother Angantyr. This was the second of Tyrfing's three evil deeds.
Heidrek became king of the Goths. During a voyage, Heidrek camped at the Carpathians (Harvaða fjöllum, cf. Grimm's law). He was accompanied by eight mounted thralls, who eventually entered his tent and slew him in his sleep, the third and final of Tyrfing's evil deeds. Heidrek's son, also named Angantyr (the third), caught and killed the thralls and reclaimed the magic sword, finally satisfying the dwarves' curse.
Angantyr was the next king of the Goths, but his illegitimate half-Hun brother Hlod (or Hlöd, Hlöðr) wanted half of the kingdom. Angantýr refused, and Gizur called Hlod a bastard and his mother a slave-girl. Hlod and 343,200 mounted Huns invaded the Goths (See The Battle of the Goths and Huns). The Huns greatly outnumbered the Goths. The Goths won because Angantyr used Tyrfing to kill his brother Hlod on the battleground. The bodies of the numerous warriors choked the rivers, causing a flood which filled the valleys with dead men and horses.
The curse on Tyrfing is comparable to that placed on the ring Andvaranaut in the Völsung Cycle.
For links to source text in English translation and Old Norse and for general commentary see Hervarar saga ok Heiðreks.