Gandalf was one of the five Istari sent to Middle-earth by the Valar in the Third Age. In Valinor he was known as Olórin. Gandalf was instrumental in bringing about the demise of Sauron in T.A. 3019, chiefly by encouraging others and dispensing his wisdom at pivotal times. Gandalf was originally robed in grey, and second to Saruman in the Order of wizards. After his fall in Moria, Gandalf returned to Middle-earth as head of the Order, robed in white. Gandalf was noteworthy for his keen interest in Hobbits.
Olórin was a Maia who dwelt in the gardens of Irmo in Valinor. As a pupil of Nienna, Olórin was said to be the wisest of the Maiar; he learned pity and patience from his teacher.
During the Third Age, while Sauron's 'dark spirit of malice' was increasing over Middle-earth, the Valar chose five emissaries from among the Maiar to go and help the peoples. Manwë selected Olórin, who, at first, did not wish to go, as he feared Sauron. However, Manwë said that that was all the more reason why he should go. Furthermore, the One Ring, the location of much of Sauron's power, presumably still existed somewhere in Middle-earth.
Olórin submitted to the will of Manwë, and departed Valinor to Mithlond in the year T.A. 1000.[5] He arrived after the others, Curumo, Aiwendil, Pallando, and Alatar, at about the same time the Necromancer appeared in Mirkwood.