Zoroastrian cosmology, the Middle Eastern precursor of Islam, conceives the history of the world as a vast drama. In Infinite Time there existed Ormazd, who dwelt in the light, and Ahriman, who dwelt below him in the darkness. Ahriman crossed the Void which separated the two Beings and attacked Ormazd, who perceived that their struggle would last forever unless realized in finite terms. He made a pact with Ahriman limiting the duration of their struggle. Ormazd then recited the Ahuna Vairya, the most sacred prayer of the Zoroastrians. Ahriman, aghast, fell back into the abyss where he lay for another 3,000 years. During this time Ormazd called creation into being, first the spiritual creation including the Beneficent Immortals, then a corresponding material creation--sky, water, earth, plants, the Primeval Ox, and Primeval Man (Gayomart). Next, to the fravashis (preexistent souls) of men, Ormazd offered a choice between staying forever in their embryonic state and becoming incarnate in the physical world in order to secure his triumph over Ahriman (...gosh, that sounds like The Matrix); they chose birth and combat. Meanwhile Ahriman, in the Abyss, generated six demons and an opposing material creation.

    According to Zoroaster, during his life the world was soon to be consumed in a mighty conflagration. The Wise Lord's nemesis, Ahriman, the principle of evil, was a cosmic threat. This ethical dualism is rooted in the Zoroastrian cosmology, where in the beginning there is a meeting of the two spirits which choose "life or not life." Through his good deeds, the righteous person (ashavan) earns an everlasting reward, namely integrity and immortality. He who opts for the lie is condemned by his own conscience as well as by the judgment of the Wise Lord and must expect to continue in the most miserable form of existence, one more or less corresponding to the Christian concept of hell. Thus, the world is divided into two hostile blocks, whose members represent two warring dominions. On the side of the Wise Lord are the settled herdsmen or farmers, caring for their cattle and living in a definite social order. The followers of the Lie (Druj) are thieving nomads and enemies of order.
Sources:
Encyclopedia of hell / Miriam Van Scott (New York : St. Martin's Press, 1998)
Encyclopedia of heaven / Miriam Van Scott (New York : St. Martin's Press, 1998)