After obtaining the Master Sword in the Lost Woods, Link receives a telepathic message from Princess Zelda and the Loyal Sage at the Sanctuary, saying that they are under attack. Link travels to the Sanctuary, and finds the Loyal Sage dying. Before he dies, he informs the hero that Princess Zelda was taken to Hyrule Castle by Agahnim.
It is the highest tower of Hyrule Castle and can only be accessed from the roof of the main body of the castle. There is an energy barrier that can only be destroyed with the Master Sword blocking its entrance.
Within the Tower
The tower is essentially linear and features few puzzle-oriented challenges. Instead, Link often must fight his way past numerous enemies and eventually reaches the top, where he finds Agahnim waiting for him. Link is too late, however, as Agahnim sends Zelda into the Dark World right before his eyes. After engaging and defeating Agahnim, Agahnim warps Link and himself to the Dark World as well.
Interestingly, Link receives no items for clearing the dungeon and acquires no new weapons during his ascent to the top of the tower.