The Hobbit Chapter 18
When Bilbo wakes, he is cold. He looks around and can see no living goblins. There is no one else around either. A man comes in Bilbo's direction and he speaks. He takes off his ring. No one had picked him up because they could not see him. The man tells Bilbo that they have been searching for him. Bilbo doesn't feel well so the man picks him up and carries him back to Dale. When Gandalf sees him, he is delighted. He immediately leads him to Thorin. Thorin is lying down and suffering from many grave wounds. He is dying. He begs Bilbo to allow him to take back the terrible things he said to him before. Bilbo accepts his apology, and the dwarf dies. Bilbo weeps and curses himself for the business with the Arkenstone. He aches for his own home.
The eagles had watched the goblins gather in strength for quite some time. They followed the mass movement, expecting trouble. When they arrived at the battle, they began to swoop down, pick up the goblins, and drop them on the ground from a great height. Even with the eagles, however, the numbers were still too great. The tide of the battle stayed the same until Beorn showed up. He rushed into the battle and rescued Thorin from an immediate death. Then he grabbed Bolg himself and killed him brutally. With their leader dead, the goblins fractured and the battle turned against them. Many perished in the valley and the eagles chased after those who fled.
Dain swears friendship with the eagles and buries his cousin with the Arkenstone and his sword by his side. The dwarves crown him the king. Fili and Kili also perished in the battle. The fourteenth share of the treasure is given to Bard. The Elvenking is given a great collection of emeralds. Dain offers Bilbo as much of the treasure as he wants, but Bilbo carries away only a small chest each of gold and silver. He bids farewell to the dwarves and asks them to visit if they ever come near his home.
Gandalf and Bilbo ride alongside the Elvenking as far as Mirkwood. The Elvenking invites them to come back to his palace and then be escorted through the forest. Bilbo refuses to return through Mirkwood. He admits to the king that he stole a great amount of wine and bread while he was wandering through his home. He gives him a pearl necklace as recompense. The Elvenking is impressed with this and he blesses the hobbit. Gandalf, Beorn, and Bilbo travel north of the forest and all the way around until they arrive once again at Beorn's home. They stay there through the winter. With the wargs and goblins all but extinct, the area becomes more peaceful and many men begin to settle in the area. Beorn becomes a chief of these settlers for many years.
In the spring, they leave and return over the Misty Mountains. Bilbo looks back and squints at Lonely Mountain, so very far away. He says "'So snow comes after fire and even dragons have their ending! I wish now only to be in my own arm-chair!'" Chapter 18, pg. 294