The Witch-king and the other Nazgūl rode from Mordor and Dol Guldur searching for the Shire. Four entered the Shire, and found that "Baggins" had moved to Buckland. Several Nazgūl attacked Gandalf onWeathertop and tried to ambush Frodo Baggins in Buckland and at Bree. Five, including the Witch-king, finally found Frodo on Weathertop with the other hobbits, accompanied by the Ranger Aragorn. The Ringwraiths attacked the party, and the Witch-king wounded Frodo with a Morgul-blade. Frodo's wound threatened to turn him into a wraith under the control of the Nazgūl.
As the company made for Rivendell, the realm of Elrond Half-elven, they met Glorfindel, who loaned Frodo his horse Asfaloth. Pursued by all nine Nazgūl, the horse carried Frodo across the River Bruinen. From the far bank Frodo defied the Nazgūl. When the Witch-king rode into the water, Elrond, who controlled the river, released a flood that caught three Nazgūl and their horses. Glorfindel advanced and drove the terrified horses of the remaining Nazgūl into the flood. The horses drowned, and all nine Nazgūl were swept away.
The three commanders agreed that the Goblins and Wargs were the enemies of all, and previous grievances between them were put on hold in face of the greater threat. They arranged their forces on the two spurs of the Mountain that lined the valley leading to the now-sealed off great gate; the only entrance to the Mountain. The Dwarves and Lake-men formed up on one spur and the Elves on the other, while a light rear-guard lined across the mouth of the valley to lure the Goblins between the two, and thus destroy them. Bilbo Baggins, while invisible due to the Ring, tried to sit out the battle on the spur held by the Elves.
Soon the Goblins and Wargs arrived (and now four armies were on the field), and at first the plan worked: they were lured into the choke point and took heavy losses. However, due to their superior numbers, the allied Free Folk did not hold the advantage long. The second wave was even worse than the first, and now many Goblins scaled the mountain from the opposite side, and began to attack the arrayed forces from above and behind, as the main wave pressed forward. The battle raged across the Mountain, and then a great noise was heard: Thorin and his twelve Dwarf companions inside the mountain had thrown down the stone wall they had erected across the mouth of the gates, killing many Goblins. Thorin and Company then charged out to join the battle, covered from head to toe in the finest armour and weapons contained in the treasure hoard of Erebor. Thorin advanced through the Goblins ranks all the way up to the gigantic Goblins that formed the Bodyguard of Bolg, whom he could not get past. The battle degenerated into a chaotic close quarters melee, no quarter asked or given.
As the battle was turning fully against the Free Folk, a number of Giant Eagles of the Misty Mountains arrived (the fifth army), led by Gwaihir, Lord of the Eagles. Bilbo was the first to spot their entrance on the scene and began shouting that "the Eagles are coming!", a shout that was then continued among the other troops of the Free Folk. At this point Bilbo was knocked in the head by a large stone thrown by a Goblin from above on the Mountain, and he passed out. With the support of the Giant Eagles, the battle turned back against the Goblins. Then Beorn himself arrived at the battle, apparently having heard news that a large army of Goblins was on the move. This time he did not appear in his former shape of a giant Man, but had changed his skin to that of a gigantic bear. Beorn drove through the Goblin lines, but paused to carry the wounded Thorin out of the battle. Beorn then returned to the battle with even greater wrath and smashed the ranks of the Bodyguard of Bolg, ultimately killing Bolg himself. The Goblins eventually panicked and scattered, to be picked off by hunting forces from the victors later; many of the Goblin survivors died in the Mirkwood forest.