One of the greatest friendships in Tolkien’s work comes out of one of the most long-held racial grudges in Middle-earth. Elves and Dwarves got along rarely and usually in the most peaceful times or the most dire need. This racial feud was overcome by two very important figures in the Third Age, and these two were Gimli, son of Glóin, and Legolas Greenleaf of the Woodland Realm.
The movies and book agree fairly well on this point and their relationship arc is portrayed very well in the theatrical version. The two join the Fellowship at Rivendell, pass through many dangers together, still holding much of their traditional grudges along the way, and finally they reach Lothlórien together. Here, something interesting begins to happen. They are seen walking through the trees of Lórien together and eventually ride in the same boat when the Company leaves.
They become better friends as the story progresses. They hunt for Merry and Pippin together with Aragorn and fight in many battles together. When they meet the Rohirrim, Éomer and Gimli exchange heated words over Galadriel and after Gimli is threatened, Legolas steps in and says that Gimli does not stand alone. In the Battle of Helm’s Deep, they have an orc-slaying contest which Gimli wins 42-41.
During the Battle at Helm’s Deep, Gimli is driven back into Aglarond, the Glittering Caves, a cavernous network in the White Mountains behind the Deeping Coomb. After the battle, the main characters pass through the strange forest of the Huorns on their way to Isengard. Gimli is frightened of them but Legolas expresses his desire to visit Fangorn Forest again, as the Huorns reminded him of that place. Gimli also tells Legolas a lengthy monologue about how beautiful the Glittering Caves were. The two come to an agreement that Gimli would go with Legolas to see the expansive Fangorn Forest if Legolas would travel with Gimli again to see the Glittering Caves.
The War continues on and the two fight side-by-side and come out alive. The movie doesn’t explain what becomes of them very well and even the book only has extra information on them in the appendices. Most would be happy to know that they lived out their bargain: Legolas took Gimli through Fangorn, and Gimli drug Legolas through Aglarond. The two helped also to rebuild Minas Tirith by bringing the skills of their own kinds to the city. In the end, Legolas did indeed depart in the West as the last member of the Fellowship to leave Middle-earth but an interesting note appears in the last few sections of the tales in the appendices:
“We have heard tell that Legolas took Gimli Glóin’s son with him because of their great friendship, greater than any that has been between Elf and Dwarf. If this is true, then it is strange indeed: that a Dwarf should be willing to leave Middle-earth for any love, or that the Eldar should receive him, or that the Lords of the West should permit it. But it is said that Gimli went also out of desire to see again the beauty of Galadriel; and it may be that she, being mighty among the Eldar, obtained this grace for him. More cannot be said of this matter.”
So it would appear as though this amazing friendship endured to the very end and was even brought into the Undying Lands, a place mortals are not typically allowed to see. Bilbo, Frodo, and Sam were able to embark with Gandalf because they were Ring-bearers, and Gandalf came from there; his time in Middle-earth ended with the fall of Sauron. Legolas was able to go because he was Elf-kind and…well, that’s just a luxury of being an Elf, I suppose. As one can see from the quote above, Gimli may have obtained this privilege simply due to his love of Galadriel and her favor of him. It is an unexpectedly happy ending.