King under the Mountain
King under the Mountain was the title taken by Thráin I, founder of the Dwarf-kingdom of Lonely Mountain, and maintained by those Kings of Durin's Folk who dwelt there. The line was broken twice, once by Thorin I (he and four generations of his descendants ruled from the Grey Mountains, not Lonely Mountain), and once by the Dragon Smaug (who claimed the title for himself). In both cases, the line was restored to a rightful heir.
 The Line of Kings under the Mountain
- Thráin I
- Thorin I – abandoned the Kingdom for the Grey Mountains
- Thrór – restored the Kingdom but lost it to Smaug
- Smaug - claimed title and kingdom after the Sack of Erebor
- Thorin II Oakenshield – regained the Kingdom
- Dáin II Ironfoot - reigned after Thorin's death in the Battle of Five Armies
- Thorin III Stonehelm
The term "King under the Mountain" is a philological term for a certain motif in various mythologies and folklore around the world. It refers to a kingly figure who remains hidden in a mountain or cave until a messianic return at the appointed time.
According to the Wikipedia article, the motif is also present at several points in Tolkien's legendarium: Ar-Pharazôn with his Great Armament was buried in the Caves of the Forgotten beneath the Pelori until the End of the World; the King of the Dead and the Men of the Mountains in Dunharrow, who returned to fulfill their oath; and of course the King under the Mountain himself, with Thorin's return to Erebor. Other figures can include Feanor and Túrin (said to return from the dead at the Dagor Dagorath); and the King of Gondor (with Aragorn as the returned King).