Gandalf was the best-known of the Maiar of Valinor, a servant of the Valar, the Powers of the world, and of Eru Ilúvatar, the One. In Valinor he was known as Olórin, and was said to be the wisest of the Maiar. He dwelt in the gardens of Irmo and was the pupil of Nienna, the patron of mercy. When the Valar decided to send the order of the Wizards to Middle-earth in order to counsel and assist all those who opposed Sauron, Olórin was proposed by Manwë. In the Order, he had a strained, competitive relationship with Saruman, its head.
Gandalf was the last Istari to arrive in Middle-earth, landing in Mithlond around 1000 TA. He seemed the oldest and least wise of them, but Círdan the Shipwright felt that he was the greatest on the inside on their first meeting in the Havens, and gave him the Ring of Fire. Gandalf hid it well and it was not known (except apparently to Galadriel and probably to Elrond) until he left with the other ringbearers at the end of the Third Age that he and not Círdan was the third holder of the Elven-rings.
Long he travelled through the Northwest of Middle-earth, where he became close friends with both Elrond and Galadriel (he may have already known the latter in Valinor). There is not much known about him until 2063, when he entered Dol Guldur, thinking that it may be the hiding place of Sauron's spirit. He was right, and Sauron, then known as the Necromancer, fled Dol Guldur, but without Gandalf finding out whether or not his suspicions were right.
In 2463 TA, the White Council was founded. Galadriel proposed that Gandalf be made the head of it, but the position of leadership was given to Saruman. In 2845 he entered Dol Guldur again. He found that the Necromancer was indeed the Dark Lord himself, and also discovered the dying dwarf Thráin II, who gave him the map and the key of Erebor. When Gandalf brought this information to the Council he urged for them to attack, Saruman disagreed and overruled him, saying Sauron had no power yet.
Gandalf arrives to recruit Bilbo Baggins. Art by Alan Lee.
Gandalf arrives to recruit Bilbo Baggins. Art by Alan Lee.
Later, in 2940, Gandalf met Thráin's son Thorin II Oakenshield in an inn in Bree, and agreed to help him and his twelve dwarf companions on their quest to reclaim their treasure, but only for a little while. He also suggested that Thorin add a fourteenth member to their party. This encounter initiated the Quest of Erebor.
Gandalf was already known to the Hobbits of the Shire as an old conjurer who entertained children with fireworks during festivals and parties. He had also aided them during the Fell Winter of 2911, and had a certain reputation for sending young hobbits on fantastic quests. Now he arranged and partially accompanied a band of thirteen dwarves and the Hobbit Bilbo Baggins for the quest of reclaiming the lost treasure of the dwarves from the dragon Smaug. It is on this quest that Gandalf found his sword, Glamdring in a troll's treasure hoard, and that Bilbo found the One Ring (though at the time it was mistaken for a lesser ring).
The story behind "The Hobbit" began in a chance meeting between Thorin and Gandalf in the inn of the Prancing Pony, in Bree. Gandalf had for some time foreseen the coming war with Sauron, and knew that the North was especially vulnerable. If Rivendell were attacked, the dragon Smaug could be used to terrible effect. Thorin was also keen on regaining his lost territory, and the quest was born. (LOTR, appendix). Unknown to the dwarves or Bilbo, Gandalf had joined the quest in order to investigate what he suspected to be the resurgence of Sauron (or the "Necromancer", as he is referred to in The Hobbit) in Mirkwood. During the dwarves' quest, Gandalf twice vanished — once to scout their path, the second time to "attend to other pressing business", the nature of which he refused to discuss.
When Bilbo found the One Ring, Gandalf was immediately suspicious of the hobbit's story of how he acquired it. He privately confronted Bilbo and forced the truth out of him, and was deeply troubled by his story of the ring's powers, as they seemed eerily familiar. Perhaps even more troubling to him was that Bilbo, a proper, honourable hobbit, would uncharacteristically lie about his story.
After escaping from the Misty Mountains pursued by orcs and wargs, it was Gandalf who called out to the Great Eagles and was able to get them to take himself, the dwarves and Bilbo to safety. It was also through an ingeniously clever plan that Gandalf was able to convince the great Beorn--who did not like uninvited guests or dwarves--to house the small company.
Before the company entered Mirkwood, Gandalf departed, saying that he had pressing business to attend to. This pressing business was a meeting of the White Council, which finally decided to act on Gandalf's information of Sauron in Dol Guldur and drive him out of Mirkwood, which they did soon after.
Gandalf managed to get back to Esgaroth, and the Lonely Mountain before the dwarves and Bilbo. He disguised himself in Esgaroth and only revealed himself when it seemed the men of Esgaroth with the elves of Mirkwood would go to war with Thorin. When an army of orcs and wargs arrived and attacked all three parties involved, the Battle of the Five Armies was initiated. After the battle, he accompanies Bilbo back to the Shire and reveals what his pressing business was: the White Council had attacked Dol Guldur and drove the Necromancer from it (although this was much later than Gandalf would have liked).
Gandalf spent the years between 2941–3001 T.A. travelling Middle-earth in search of information on Sauron's resurgence and Bilbo's mysterious ring, whilst befriending Aragorn. He spent as much time as he could in the Shire, however, strengthening his friendship with Bilbo and befriending Bilbo's heir, Frodo. It was also at about this time that he first began to be suspicious of Saruman, especially after Saruman went into Isengard.
In 3001 T.A., he attended Bilbo's "Eleventy-First" (111th) birthday party, bringing many fireworks and a giant flying firework 'dragon', indicating his knowledge of chemistry as well as magic. At the end of the party Bilbo put on the ring and disappeared at the end of his speech, as a prank on his neighbours. Troubled by this, Gandalf confronted his old friend and tried to persuade him to leave the ring to Frodo. Bilbo became hostile and accused Gandalf of trying to steal the ring — which he called "my precious," much as Gollum, the creature from whom Bilbo had taken the ring, had previously done. Horrified, Gandalf stood to his full height and almost ordered Bilbo to leave it behind. Bilbo returned to his senses, and admitted that the Ring had been troubling him lately. Bilbo then left for Rivendell, and never possessed the Ring again.
Over the next seventeen years, Gandalf travelled extensively, searching for answers. Having long sought for Gollum near Mordor, Gandalf met with Aragorn, who had captured the creature, in Mirkwood. Gandalf interrogated Gollum and learned that Sauron had forced Gollum under torture to tell what he knew about the ring, adding to Gandalf's suspicions that Bilbo carried the One Ring.
Upon returning to the Shire, in 3018, he confirmed his suspicions by throwing the Ring into Frodo's hearth fire and reading the writing. He then told Frodo the full history of the Ring, urging him to leave with it and make for Rivendell, the home of the Elves, knowing he would be in grave danger if he were to stay at home. He also told Frodo that he would attempt to meet with him again in Bree, and that Frodo had to leave quietly as the servants of Sauron would be searching for him.
Riding near the Shire, Gandalf encountered Radagast the Brown, who told him that he had been sent for by Saruman and had to see him immediately because the Nazgûl had come forth and crossed the River Anduin. Gandalf left a note for Frodo with Barliman Butterbur, an inn-keeper in Bree, and headed towards Isengard. Once there, he was disturbed by the way Saruman spoke to him, including insulting Radagast and mocking the way Gandalf addressed him. Soon enough, Saruman revealed his true colours and betrayed Gandalf, and quickly imprisoned him at the top of the tower of Orthanc. Saruman had previously come under the influence of Sauron due to his use of the palantír of Orthanc. Eventually Gandalf was rescued by Gwaihir the Eagle after witnessing Saruman begin building his army.
Gwaihir set Gandalf down in the kingdom of Rohan, where Gandalf appealed to its king Théoden for a horse. Théoden, under the influence of Saruman through his servant Gríma Wormtongue, told Gandalf to take any horse he pleased as long as he left. It was then that Gandalf met the great mearas horse Shadowfax and pursued the great horse for several days before Shadowfax permitted Gandalf to ride him. The first thing Gandalf did was ride for the Shire, only reaching it after Frodo had set out and does not meet up with him until Frodo reached Rivendell on October 20. Before he did, he faced the Nazgûl at Weathertop and drove them off; Frodo and company would face the wraiths in the same place a few nights later.
In Rivendell, Gandalf helped Elrond drive off the Nazgûl pursuing Frodo and played a great part in the following Council of Elrond as the only person who knew the full history of the Ring. It was then he also revealed that Saruman had betrayed them all by seeking the Ring himself. When it was decided that the Ring had to be destroyed, Gandalf volunteered to join and help Frodo – now the Ringbearer – in his quest. He also was the one who persuaded Elrond to let Merry and Pippin join the Fellowship.
Taking charge of the Fellowship (nine representatives of the free peoples of Middle-earth "set against the Nine Riders"), he and Aragorn led the hobbits and their companions on an unsuccessful effort to cross Mount Caradhras in winter.
Gandalf fights the Balrog. Art by Ted Nasmith.
Gandalf fights the Balrog. Art by Ted Nasmith.
After this failure to cross the mountains, it was decided that they should go through the Mines of Moria. When the Company enters they quickly discovered that the Dwarf colony that was once there had been overrun by orcs. This was an especially hard blow to Gimli, the only dwarf in the company. During an ensuing fight with the orcs of Moria, Gandalf led the company across the Bridge of Khazad-dûm, until a Balrog came to face the company. The vicious demon of the First Age – commonly called Durin's Bane – faced the Grey Wizard on the bridge of Khazad-dûm.
Gandalf broke the bridge in front of him with his staff, which also broke in the process, but as the Balrog fell it wrapped its whip around Gandalf's knees, dragging him into the abyss. As the Company looked in horror, Gandalf fell into shadow, crying "Fly, you fools!". Neither he nor the Balrog was killed by the fall into the deep underground lake under Moria. Gandalf then pursued the creature for eight days until they climbed to the peak of Zirakzigil. Here they fought for two days and nights. In the end, the Balrog was cast down and it broke the mountain-side as it fell. Gandalf himself died following this ordeal and his body lay on the peak while his spirit travelled outside of Time.
Gandalf was "sent back" from the Halls of Mandos, resurrected by Eru and returning as a more imposing figure, Gandalf the White. After being found by Gwaihir, he was healed of his injuries and reclothed in white robes by Galadriel in Lórien, though he retained his grey cloak for a while. He then travelled to head off the Three Walkers in Fangorn Forest, where he encountered Aragorn, Gimli, and Legolas who were tracking the Fellowship members (and Frodo's cousins) Merry and Pippin.
Arriving in Rohan, Gandalf found that its king, Théoden, had been weakened by Saruman's agent, Gríma Wormtongue. He broke Wormtongue's hold over Théoden, and convinced the king to join them in fighting Sauron. Gandalf then set off in search of Erkenbrand of the Westfold and his warriors to assist Théoden in the coming battle. On the final day of the Battle of the Hornburg Gandalf and Erkenbrand with his warriors arrived to break the Uruk-hai attack on Helm's Deep. After the Battle of the Hornburg Gandalf and the king went on to Isengard, which, it turned out, had been attacked and conquered by a force of Ents led by Treebeard and Merry and Pippin. After the overthrow of Saruman, Gandalf broke Saruman's staff and expelled him from the Order of Wizards and the White Council, assuming Saruman's place as head of both. He then took Pippin with him to Gondor to aid in the defence of Minas Tirith after Pippin looked into Saruman's palantír and came face to face with Sauron.
Gandalf relieved the Steward Denethor of command of the city after Denethor brooded and eventually lost his mind, after seeing his last son Faramir gravely wounded in battle, and a vision of the black ships of the Corsairs of Umbar coming to invade through his palantír. Together with Prince Imrahil of Dol Amroth, Gandalf led the defenders during the siege of the city. When the forces of Mordor finally broke through the gates of the city, Gandalf alone, with Shadowfax, confronted the Witch-king of Angmar, Lord of the Nazgûl, though their duel was never fought since the Rohirrim arrived at that moment, compelling the ringwraith to leave and engage them. Gandalf would have ridden to their aid, but he too was suddenly required elsewhere -- to save Faramir from the now-insane Denethor who sought to burn himself and his son on a funeral pyre. (Gandalf would not have succeeded, however, without the help of Beregond, a Guard of the Citadel whom Pippin had befriended). He continued to organize the city's defences while the main battle was being fought outside by the forces of Rohan and the Gondorians, eventually with the forces of Aragorn from South Gondor, against Mordor's great army on the Pelennor Fields.
Gandalf then led the final battle against Sauron's forces at the Black Gate, waging an outnumbered battle to distract the Dark Lord's attention away from Frodo and Sam, who were at the very same moment scaling Mount Doom to destroy the Ring. Before the battle Gandalf and the other leaders of the West went to try to negotiate with the Mouth of Sauron, with Gandalf as chief herald and negotiator. The Mouth revealed Frodo's mithril shirt and other items which were part of the hobbits' gear. This almost made the leaders despair, but not before Gandalf sent the Mouth of Sauron away with a rejection of Mordor's terms of surrender. The forces of the West then held out against Sauron's forces, until Gollum fell with the Ring into the fire and it was destroyed with him. The two hobbits were then saved by Gandalf, who rode upon Gwaihir and piloted several other Eagles to their rescue on the side of Mt. Doom.
After the war, he crowned Aragorn King of Gondor as King Elessar, and helped him find a sapling of the White Tree of Gondor. He accompanied the hobbits back to the borders of the Shire, before leaving to go and rest in the house of Tom Bombadil.
Three years later, Gandalf — who by now had spent over 2,000 years in Middle-earth — departed with Frodo, Galadriel, Bilbo, and Elrond across the sea to the Undying Lands. It is said he also took his beloved horse Shadowfax with him to Valinor.