Agahnim

When Hyrule became besieged by an onslaught of terrible misfortunes (pestilence, drought, etc.), the King of Hyrule offered a reward to anyone who could put an end to these disasters. A mysterious stranger named Agahnim came and put an end to these troubles with a previously unknown magic. He was declared a hero and given the prestigious positions of chief advisor to the King and heir to the Seven Wise Men. Agahnim used this position and his mysterious magic to brainwash all of Hyrule's soldiers, dispose of the King of Hyrule, and make six of the descendants of the Seven Wise Men disappear to the Dark World.

After being rescued by Link, Zelda, the last of the descendants, hides in the Sanctuary until Agahnim's troops find her and take her to the tower at the top of Hyrule Castle. There, Agahnim sends her to the Dark World, thus breaking the Seal of the Seven Wise Men. Before Link can soundly defeat him, Agahnim draws him into the Dark World. During his quest to rescue the Seven Maidens, Link learns that Agahnim is a servant, or perhaps a pawn, of Ganon.

When Link defeats Agahnim at the top of Ganon's Tower in the Dark World, this time for real, Agahnim collapses and from his body a faint image of Ganon appears. The image turns into a bat and flees to the Pyramid of Power.

Agahnim's relationship with Ganondorf is occasionally debated. While some believe that Agahnim was just a wizard who Ganondorf corrupted and used to do his work in the Light World (Hyrule), many others maintain that Agahnim was merely a disguise used by Ganon. This theory is strongly supported by the fact that Ganon appears from within Agahnim's body, and that in the final battle Ganon refers to Agahnim as his "alter-ego".

Strategy
When attacking, Agahnim hurls magical attacks against Link. The first of them, a magic ball, can be hit with the Master Sword to reflect it, so that it hits Agahnim himself and wounds him. The second one can also be hit with the sword, but it splits up and flings fireballs throughout the room. The third one is a lightning attack which Link can only avoid by standing at Agahnim's side. If Link strikes at Agahnim's body with the Master Sword, he will receive a violent electrical shock.

While he fights alone in Hyrule Castle, in Ganon's Tower he creates clones of himself to irritate Link. This can work to Link's advantage, since the clones only produce magic balls that can be bounced back with the sword.

Agahnim also made a small cameo appearance in Link's Awakening, appearing as one of the forms of the final Nightmare in the Wind Fish's Egg. Here he can be defeated the same way as in the previous game, with the reflections of the magic balls.

In Oracle of Seasons he appears in 4th Dungeon, Dancing Dragon Dungeon as a Mini-Boss. He splits himself in three parts, and you have to guess which one is real (you can tell that easy because the real Agahnim has a shadow, the other two don't). You can simply hurt him by slashing him with Wooden Sword.

Trivia

 * The eye symbol that Agahnim has on the front of his robes in the official artwork, as well as a design throughout Hyrule Castle when on the way to confront him, strongly resembles the symbol of the Sheikah.
 * The mini-boss of Ancient Tomb "Blue Stalfo" attacks in a quite similar manner to Agahnim, except that he cannot create lightning, but instead turns Link into a baby.