In Ocarina of Time (1998), Zelda first appears as a child. Suspicious of the Gerudo King Ganondorf, she charges Link with the task of collecting the three spiritual stones to open the door to the Sacred Realm and obtain the Master Sword and Triforce before Ganondorf does. Just before Link pulls the Master Sword from its pedestal, Ganondorf reveals his wicked intentions and Zelda flees Hyrule Castle with her guardian Impa before he can capture either of them. Still in hiding seven years later, she poses as a young Sheikah named Sheik. In this disguise, she offers Link advice and assistance throughout the remainder of his quest until revealing her true identity and being captured by Ganondorf. After Link rescues her, Zelda works with him to escape the collapsing castle, guiding him and using her powers to open sealed gates. When Link defeats the resurrected Ganon, she and the other six sages are able to seal Ganon away in the Sacred Realm. After this, she sends Link back to his own time, seven years earlier.