The story of the messianic hero is, of course, a universal one. It's at the heart of numerous religious traditions and stirs the human imagination like few other tales.
But in the feverish world of Game of Thrones fan-sites and discussion boards, a fair amount of thought has been given to the possible historical provenance of the Azor Ahai legend.
Martin himself has said he developed the idea of the monotheistic, fire-worshiping faith surrounding R'llhor from Zoroastrianism, a pre-Islamic religion that emerged thousands of years ago in what's now Iran.
Beyond the purifying importance of fire in rituals in both faiths, Iran's ancient traditions gave realms further west the first understanding of a moral universe shaped by a binary good and evil.
God in Zoroastrianism is known as Ahura Mazda, an omnipotent, supreme figure who created the twin spirits of good and evil - Spenta Mainyu and Angra Mainyu, also known as Ahriman.
There are interpretations of the tradition that associate Ahura Mazda purely with the former, a life-giving creator, and place him at odds with Ahriman, a being that ultimately must be defeated.
Here's more from the entry on the deity in the Encyclopedia Britannica:
"To aid him in attacking the light ... Ahriman created a horde of demons embodying envy and similar qualities. Despite the chaos and suffering effected in the world by his onslaught, believers expect Ahriman to be defeated in the end of time by Ahura Mazdā. Confined to their own realm, his demons will devour each other, and his own existence will be quenched."
This sense of eternal struggle and combat with an evil Other is hardly unique to Zoroastrianism.
But it is the most clear blueprint for the cosmic clash being set up in Game of Thrones, where Ahura Mazda is a composite of both R'llhor and Azor Ahai, and where a righteous hero of fire will eventually take on a relentless evil from the lands of ice.