.The poem is sung by Bilbo Baggins at the Grey Havens, as he is about to leave Middle-earth forever. Chronologically this places it at the very end of The Return of the King, the last book of The Lord of the Rings, although it was written later than the books and was never included in them <3