The Witch-king was originally a human king. In the Second Age, he was given one of nine Rings of Power to help rule over his realm. However he and eight others were betrayed by Sauron, the Dark Lord of Mordor when he crafted for himself the One Ring. The Rings originally gave them incredible power, which they used to further their own ambitions, but eventually the Rings completely corrupted them and turned them into the ghostly, undead Nazgûl, bound in servitude to Sauron until he himself was destroyed.
The first sighting of the Nazgûl in Middle-earth was reported in 2251 of the Second Age. For the next 1200 years, the Lord of the Nazgûl would serve Sauron as his second in command. He fought in the war against the Last Alliance of Elves and Men between 3434 and 3441 of the Second Age. It was in 3441 that Sauron was defeated by Isildur and the nine Nazgûl disappeared from Middle-earth.