Agahnim

Agahnim (アグニム, Agunimu) is the dark wizard who serves as one of the primary villains of The Legend of Zelda: A Link to the Past.

A Link to the Past
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, priest, and heir to the Seven Sages. 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 Sages 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 Sages. He gloats that nothing can stop him now, because the Tribe of Evil is armed with the Triforce, and that evil and darkness will soon overrun the Light World. With this, he seemingly vanishes, but Link is able to discover his whereabouts by slicing open a curtain and revealing a hidden chamber where he duels the Dark Wizard, turning his own magic against him. But 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 a second time at the top of Ganon's Tower in the Dark World, he collapses, and from his body a faint image of Ganon appears. The image turns into a bat and flees to the Pyramid of Power. At the start of the final battle, Ganon reveals that Agahnim was in fact his alter ego.

Strategy
Even with the Master Sword, Link is unable to harm Agahnim directly, and must use the sword to turn his own magic against him.

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. The lightning strike cannot be reflected. 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 confuse Link. This can actually work to Link's advantage, as the clones only produce magic balls that can be bounced back with the sword.

Identity
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". In the Japanese version of A Link to the Past, Ganon referred to Agahnim as his "ぶんしん," or bunshin, the same word used to describe the clone attacks of Meg the Poe in Ocarina of Time. This may indicate that Ganon used magic to split himself in two and disguised his alter ego as Agahnim.

Other Appearances
Agahnim also made a 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 a wizard resembling Agahnim makes a cameo in the fourth dungeon, Dancing Dragon Dungeon, as a mini-boss. He splits himself in three parts, and Link must guess which one is real (the real wizard has a shadow, the other two don't). Link can simply hurt him by slashing him with the Wooden Sword.

Comic
Agahnim appears in the comic book adaptation of A Link to the Past. Here, he is the murderer of Link's Uncle and appears to die when Link defeats him atop Hyrule Castle. The Agahnim that Link fights at Ganon's Tower is an illusion created by Ganon. Like most adaptations of the game, Agahnim is a separate entity from Ganon, rather than his alter ego.

Manga
In the Triforce of the Gods manga by Akira Himekawa, Agahnim is given a backstory as a friend to Link's Father. He studied to become a magician while his friend trained to become a Knight of Hyrule. When Link's father told him the story of the Imprisoning War and the Triforce, Agahnim became intrigued and researched for ways to break the ancient seal. When Link's father confronted him about his investigations, he used his magic to trap Link's parents in the Dark World. He then struck a bargain with Ganon: he would undo the seal of the Sages and Ganon would grant him powerful magic.

Agahnim also exhibits some attraction to Princess Zelda, as he tells her just as he is about to send her into the Dark World.

Aganim also appears in the earlier Triforce of the Gods manga by Ataru Cagiva. His portrayal is similar to that of the game, but the manga shows him doing good deeds with his magic so that the people will not suspect his treachery.

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 Blue Stalfos mini-boss of Ancient Tomb attacks in a quite similar manner to Agahnim, except that he cannot create lightning, but instead turns Link into a baby.
 * Strangely enough, Agahnim's fireballs can be reflected back at him by hitting them with the Bug Catching Net. This is referenced in later games by the fact that the player can reflect Ganon's attacks by swinging an Empty Bottle.
 * His in-game sprite strongly resembles Ganondorf's Gerudo form dressed in green robes.
 * The battle against Agahnim was one of the first examples of Tennis in the series.
 * Agahnim and Ganon share the same theme music. This music later became Ganondorf's leitmotif in future games.