The King of Shadows (known also as The Guardian), is the main antagonist of the game. He is a former Guardian, a powerful creation of the ancient fallen empire of Illefarn, the result of turning a man into a creature of unlimited magic power. The Guardian was to be powered by the Magic itself, but with the fall of Illefarn, he "switched" to another power source: the Plane of Shadow. Now, he is a monster that is about to come to the Sword Coast again, leading an army of followers, undead and creatures of the Plane of Shadow. The only way to destroy him is to use the Gith Sword against him, so his connection with the Plane of Shadow can be sundered. He is defeated in his underground lair beneath the Mere of the Dead Men.
Source: Wikipedia, "List of Neverwinter Nights characters", available under the CC-BY-SA License.