Imam Sadiq (peace be upon him): Abu Basir said: I asked Imam Sadiq (peace be upon him) about the interpretation of this verse: وَ یَسْئَلُونَکَ عَنْ ذِی الْقَرْنَیْنِ قُلْ سَأَتْلُوا عَلَیْکُمْ مِنْهُ ذِکْراً [And they ask you about Zulqarnain. Say: I will recite to you an account of him]. The Imam (peace be upon him) said: "Allah sent Zulqarnain to his people, and they struck him on the right side of his forehead. So Allah caused him to die for five hundred years, and after that raised him up again. They struck him on the left side of his forehead. So Allah caused him to die for five hundred years, and after that raised him up again and placed the west and east of the earth under his authority — from where the sun rises to where it sets. This is the meaning of Allah's words: 'Until he reached the setting-place of the sun, [and there] he perceived [and it appeared to him] that the sun set in a dark, muddy spring… and Allah will punish him with a severe punishment!' (Kahf/86–87)." The Imam (peace be upon him) said: "In the fire. Zulqarnain built a door before them of copper, iron, pitch and tar, and blocked their coming out. Not one of them dies without a thousand male offspring being born from his loins. They are, after the angels, the most numerous of created beings."
Amir al-Mu'minin Ali (peace be upon him) was asked: "Was Zulqarnain a prophet or an angel?" The Imam (peace be upon him) said: "He was neither a prophet nor an angel. Rather he was only a servant among the servants of Allah who loved Him, and Allah loved him in return, and he had sincerity of intention. Allah sent him to his people. They struck him on the right side of his forehead and he lay unconscious for the period Allah willed. Then he was raised up again, and this time they struck him on the left side, and again by Allah's will he lay unconscious for a time, until he was raised up a third time and Allah gave him power upon the earth. And among you is one like him — meaning himself, Imam Ali (peace be upon him). He reached the setting-place of the sun and saw the sun setting in a dark, muddy spring, and he found there a people. 'We said: O Zulqarnain! Do you wish to punish [them], or to adopt a kind way with them?' (Kahf/86). Zulqarnain said: 'As for one who has done wrong, we shall punish him; then he will be returned to his Lord, and Allah will punish him with a severe punishment!' (Kahf/87). Then [again] he made use of the means [available to him] (Kahf/89) — meaning a sign and guide — until he reached the rising-place of the sun, [and there] he saw the sun rising upon a people for whom We had made no cover against [the rays of] the sun [and they had no shelter at all] (Kahf/90). He said: they did not know the craft of sewing clothes. Then [again] he made use of the means [available to him] (Kahf/89) — meaning a proof and sign — [and he continued on his way] until he reached between two mountains, and beside those two (mountains) he found a people who understood almost no speech [their language was peculiar to themselves]. [That group] said to him: 'O Zulqarnain! Yajuj and Majuj cause corruption in this land. May we assign to you a payment, that you may set up a barrier between us and them?' (Kahf/93–94). Zulqarnain said: 'That which my Lord has placed at my disposal is better [than what you propose]! Aid me with strength, that I may set up a strong barrier between you and them! (Kahf/95–96).' They brought it to him, and he placed it between the two escarpments — meaning the two mountains — and by it he filled the empty space between the two mountains. Then he ordered them to bring fire. When they brought fire, they made the iron molten with it and poured copper upon it and sealed the cleft completely. This is the meaning of Allah's words: 'Bring me great pieces of iron [and stack them one upon another]!' until when he had completely covered [the space] between the two mountains, he said: '[Kindle fire around it, and] blow into it!' [They blew] until it made the pieces of iron red and molten… to bore through it (Kahf/96–97). Zulqarnain said: 'This is a mercy from my Lord! But when my Lord's promise comes, He will crumble it down; and my Lord's promise is true! (Kahf/98).' At the end of time, before the Day of Resurrection, this barrier will be destroyed and Yajuj and Majuj will come out and devour people. This is the meaning of this verse: 'Until when Yajuj and Majuj are opened, and they descend swiftly from every elevation.' (Anbiya/96). Zulqarnain went to the west, and on his way came to a village and roared like an enraged lion; from his roar there arose darkness, thunder, lightning and thunderbolts that destroyed those who opposed and were his enemies. As soon as he reached the west of the sun, all the people of the earth came under his rule. This verse refers to this matter: 'We gave him power and dominion upon the earth, and We placed the means of everything at his disposal.' (Kahf/84) — meaning a sign. It was said to Zulqarnain: 'Allah has a spring on the earth called the Spring of Life, and any living creature that drinks of its water will not die until the Day of Resurrection.' Zulqarnain summoned Khidr (peace be upon him), who was the best of his companions, along with three hundred and sixty other men, and gave each of them one fish and said: 'Go to such-and-such a place, for there are three hundred and sixty springs there. Each of you should wash his fish in one of those springs.' They went and did so. When Khidr (peace be upon him) was sitting and washing his fish, the fish jumped out of his hand and went into the spring. Khidr (peace be upon him) was greatly astonished at what he had seen and said to himself: 'What answer shall I give Zulqarnain?' Then he took off his clothes and went after the fish and drank of that water, but he could not catch the fish. So they returned to Zulqarnain. Zulqarnain ordered the fish to be taken from his companions. When it was Khidr's (peace be upon him) turn, the fish was not with him. Zulqarnain summoned him and asked him: 'What became of the fish?' Khidr (peace be upon him) told him the story of the fish. Zulqarnain asked: 'When the fish escaped, what did you do?' Khidr (peace be upon him) answered: 'I swam in the water and searched for the fish, but I did not find it.' Zulqarnain asked: 'Did you drink of that water?' Khidr (peace be upon him) answered: 'Yes.' Then Zulqarnain searched for the spring and did not find it, so he said to Khidr (peace be upon him): 'You are the master of that spring.'"