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.
Paths of the Dead
The way is shut.
It was made by those who are Dead.
And the Dead keep it.
The way is shut.
Until the time comes.
At the end of the Second Age, their king, known as the King of the Mountains, pledged allegiance to Isildur at the Stone of Erech. However, these Men later refused to aid Isildur in his war against Sauron; they came to the aid of neither side, but instead hid in the mountains. They had previously worshipped the Dark Lord during the Dark Years. As punishment, Isildur cursed them, saying that they would not have peace or rest till they fulfilled their oath upon his command or that of his heirs.
Their spirits haunted the caverns beneath the Dwimorberg, the Haunted Mountain, and the valley of Harrowdale that lay in its shadow—though they were said to appear in the valley only in times of trouble or death, haunting the hill of the Stone of Erech.
Malbeth the Seer prophesied that a day would come when need and haste would drive one of Isildur's heirs to take the Paths of the Dead and that the Dead would answer to his call. Thousands of years later, in the final years of the Third Age, that prophecy was fulfilled. In the War of the Ring, Aragorn, Isildur's heir and direct descendant, called upon the Dead, summoning them to the stone of Erech, and commanded them to fulfil their oath and be free. On this occasion, he first uses the royal banner of Gondor, made by Arwen and delivered to him by Halbarad and the Grey Company.
They followed him through Gondor's lands and fiefs south of the Mountains, and at the port of Pelargir they drove away the Corsairs of Umbar, allies of Sauron. Their oath fulfilled, Aragorn granted them their freedom, and they vanished at last from the world. After this, Aragorn gathered the warriors of the region to him. They sailed to Minas Tirith on the Corsairs' own ships, and turned the tide at the Battle of the Pelennor Fields.