A long knife forged in the First Age by the elves of Gondolin.

In The Hobbit, Sting was found by Thorin Oakenshield and his companions, on their Quest of Erebor in TA 2941. Along with the swords Glamdring and Orcrist, it had lain long in a troll-hoard but how it had come there from Gondolin was not known.

Elrond identified the knife as being from Gondolin and used in the Goblin Wars of the First Age. Like the swords it had the virtue of glowing blue when Orcs were nearby. Elrond surmised that it had been plundered many times before it came to the troll-hoard but who wielded it and how it was borne out of the ruins of Gondolin in FA 510 is a mystery.

The knife was of an ideal length to serve a Bilbo Baggins as a sword. He wore it and used it to good effect throughout his adventures. After killing one of the Giant Spiders of Mirkwood he named the blade Sting and it was known by that name ever after.

When Bilbo retired to Rivendell in TA 3001 (1401 SR) he took Sting with him but bestowed it upon his heir Frodo Baggins in December TA 3018 (1418 SR) when Frodo set out to destroy the One Ring. In the pass of Cirith Ungol, Samwise Gamgee used Sting in his epic fight with Shelob after she had wounded Frodo. Sting was still in Sam’s possession when Frodo was captured, and helped Sam fight his way through to free him. From that time on Sting was mostly worn by Sam, although Frodo was persuaded to wear it to the victory feast on the Field of Cormallen.

Frodo bequeathed Sting and all his other possessions to Sam when he sailed to the West.

Note: Additional information from Cirdaneth
Encyclopedia entry originally written by Hathaldir