Dwarves, Elves, and Men joined ranks against them, which led to the Battle of Five Armies. During this battle, Thorin's nephews Fíli and Kíli were killed, and Thorin himself was mortally injured; he died shortly afterwards. The title of King under the Mountain passed to Dáin.