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 in order to break the seal on the door to the Sacred Realm, so as to obtain the Master Sword and use it against Ganondorf, as well as to obtain the Triforce before he does. Just before Link pulls the Master Sword from its pedestal, Ganondorf reveals his wicked intentions and Zelda must flee 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 finally revealing her true identity as Princess Zelda. Thus exposed, she is finally 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. After the credits, we see young Link again approaching the princess in the Hyrule Castle courtyard. This child version of this incarnation appears briefly in Majora's Mask, although this is only a cameo appearance in a flashback as Link is remembering an earlier meeting between the two of them.