Allah the Almighty says “And they ask you about Dhul-Qarnain. Say, “I will tell you something about him. We established him in the land, and we gave him the means of everything so he pursued a course. Until, when he reached the setting of the sun, he found it setting in a murky spring, and he found a people in its vicinity. We said, “O Dhul-Qarnain: you may either inflict a penalty, or else treat them kindly.”
He said, “As for him who does wrong: we will penalise him, then he will be returned to his Lord, and He will punish him with an unheard-of torment.” “But as for him who believes and acts righteously: for him is the finest reward, and we will issue easy commands for him.”
Then he pursued a course. Until, when he reached the rising of the sun, he found it rising on a people for whom we had provided no shade from it. So it was. And We had full knowledge of everything he had. Then he pursued a course. Until, when he reached between the two barriers, he found beside them a people who could hardly understand a word.
They said, “O Dhul-Qarnain! Ya’juj and Ma’juj are spreading chaos throughout the land. Can we pay you, to build between us and them a wall?” He said, “What my Lord has empowered me with is better. But assist me with manpower, and I will build between you and them a dam.” “Bring me blocks of iron.” And when he had levelled the two cliffs, he said, “Blow.”
And when he made it as fire, he said, “Bring me tar to pour over it.” So they could not climb it, nor could they dig through it. He said, “This is a mercy from my Lord. But when the promise of my Lord comes true, He will crumble it to dust. And my Lord’s promise is true.” (18:83-98) Surah Al Kahf
Dhul-Qarnain was a man endowed by Allah with many talents and abilities, including military prowess, the ability to rule kingdoms, and extensive practical knowledge of many aspects of life.
He was also a pious and steadfast Muslim who constantly contemplated the signs of Allah and lived his days travelling from one destination to the next in order to establish justice in the land and alleviate the suffering of the people. Dhul-Qarnain travelled extensively in his life. He ruled the earth from east to west.
One of these travels brought him to the West, where he found the sun setting as if in a spring of dark mud. In this location, he discovered a community who were living under oppressed conditions. Therefore, Dhul-Qarnain led them to the correct path and ways of life in accordance with the rulings of the Almighty. He liberated the community from the oppression that they were subject to, inflicted punishment upon the oppressors, and criminals, and aided the weak and oppressed until justice was established in the land.
Having completed his task, he and his army continued on their journey, until one day, against the rising sun, he found a people who were backward and ignorant, living in the open without any shelter or protection against the sun. He educated the community there on what they needed to do. He shared and imparted his knowledge to them, taught them the skills required such as carpentry and agriculture, and then continued on his journey.
The next part of his journey is the most astounding, where he met a curious community, so far removed that he barely understood their language.
They were suffering from some creatures called (Ya’juj and Ma’juj), and they asked Dhul-Qarnain for help. Allah gave Dhul-Qarnain the knowledge to solve the predicament of the people there, and so he instructed them to build a gigantic wall or dam of iron between the two mountains and then pour molten copper to strengthen and increase its impenetrability.