Legolas is Prince of Mirkwood, the son of King Thranduil, descendants from the royal line of Sindarin elves. The age of Legolas is not known, though it is thought that he is millennia old. He is first introduced in the first volume of The Lord of the Rings, The Fellowship of the Ring, at the council of Elrond. He comes as a messenger from his father to discuss the escape of Gollum. Elrond picks him to become one of the members of the Fellowship that sets out to destroy the One Ring.
Within the Fellowship, Legolas and the dwarf Gimli clash, because of the sundering of the relationship between elves and dwarves after the destruction of Eregion, and also because Legolas's father Thranduil once imprisoned Gimli's father Gloin (as described in The Hobbit). They become friends, however, when they enter Lothlórien and Gimli greets the Lady of the Golden Wood with gentle words. Afterwards the two become fast friends.
After the destruction of the One Ring and of Sauron, the two go off traveling together through Fangorn. Eventually, Legolas comes to Ithilien with some of his people, with his father's leave, to live out his remaining time in Middle-earth. After the death of King Elessar, Legolas leaves Middle-earth to go over the Sea, and Gimli's love for his friend, and the desire to see Galadriel once again, prompts him to go with Legolas.