What literary work inspired Led Zeppelin’s “The Battle of Evermore” song?

What literary work inspired Led Zeppelin’s “The Battle of Evermore” song?
The Lord of the Rings
The Lord of the Rings is an epic high fantasy novel by the English author and scholar J. R. R. Tolkien. Set in Middle-earth, the world at some distant time in the past, the story began as a sequel to Tolkien’s 1937 children’s book The Hobbit, but eventually developed into a much larger work. Wikipedia