The earliest mention of Dhu l-Qarnayn, outside the Qur'an, is found in the works of the earliest Muslim historian and hagiographer, Ibn Ishaq, which form the main corpus of the Sira literature. Ibn Ishaq's Sira reports that the eighteenth chapter of the Qur'an (which includes the story of Dhu l-Qarnayn) was revealed to Muhammad by God on account of some questions posed by rabbis residing in the city of Medina - the verse was revealed during the Meccan period of Muhammad's life. According to Ibn Ishaq, Muhammad's tribe, the powerful Quraysh, were greatly concerned about their tribesman who had started claiming prophethood and wished to consult rabbis about the matter. The Quraysh sent two men to the rabbis of Medina, reasoning that they had superior knowledge of the scriptures and about the prophets of God. The two Quraysh men described their tribesman, Muhammad, to the rabbis. The rabbis told the men to ask Muhammad three questions:The famous story goes that when Muhammad was informed of the three questions from the rabbis, he said that he would have the answers in the morning but did not say "if God wills it". For fifteen days, Muhammad awaited eagerly for the revelation. Muhammad did not answer the question until then. Doubt in Muhammad began to grow amongst the people of Mecca. Then, after fifteen days, Muhammad received the revelation of al-Kahf as an answer to the questions.
Verses 9 - 26 of the chapter tell the story of the "People of the Cave" (believed by some to be the Seven Sleepers of Epheseus in Christian martyrology). Some number of young monotheistic men lived in a time where they were persecuted. They fled the city together, and took refuge in a cave where they fell asleep. God caused them to remain sleeping for approximately 300 years, and when they woke the surrounding area had become monotheistic as well.
Surah al-Kahf also mentions the ruh, or soul/spirit in verse 28, and in the Parable of Two Men in verses 32 - 44. This story discusses two men who had both been given blessings from God, but one wronged his soul by saying that none of it could ever be taken away from him. At the end of the parable God destroys what he had given the man.
The third main story within the chapter (verses 60 - 82) is that of Moses traveling to gain knowledge from another servant of God who is never mentioned by name, but from other sources is called Al-Khidr.
Ibn Ishaq's original work is lost, but it has been almost completely incorporated in Ibn Hisham, another early Muslim historian. Ibn Hisham collected Ibn Ishaq's Sira and added his notes to it; in regard to Dhul-Qarnayn, Ibn Hisham noted:
- "Dhu al-Qarnain is Alexander the Great, the king of Persia and Greece, or the king of the east and the west, for because of this he was called Dhul-Qarnayn [meaning, 'the two-horned one']..."
The theme, amongst Islamic scholars, of identifying Dhul-Qarnayn with Alexander the Great appears to have originated here. Why Ibn Hisham made this identification is not entirely clear. Aristotelian Muslim philosophers, such as Al-Farabi, Avicenna, and Al-Kindi enthusiastically embraced the concept of Dhul-Qarnayn being an Ancient Greek king. They stylized Dhul-Qarnayn as a Greek philosopher-king. In later days, some scholars, for example Maududi, identifies Dhul-Qarnayn as Cyrus the Great.
Most Muslim scholars do not believe he was of Greek origin but a man of God, a religious man who was able to build a partition to save people from Gog and Magog. In accordance with some Islamic jurisprudence, near the End Times, Gog and Magog will learn the secret that will set them free and they will once again wreak havoc upon the world.
- And say not of anything: Lo! I shall do that tomorrow,
- Except if Allah wills it. And remember thy Lord when thou forgettest, and say: It may be that my Lord guideth me unto a nearer way of truth than this.