---
title: "Dhul-Qarnayn: The Just King Who Travelled East and West | Islam Is Mercy"
description: "Who was Dhul-Qarnayn? The Qur'an's portrait of a powerful, just ruler who built a barrier against Gog and Magog and credited it all to God's mercy."
lang: en
url: https://islamismercy.com/en/history/dhul-qarnayn/
---

1.  [Home](https://islamismercy.com/en/)
2.  [History in the Qur’an](https://islamismercy.com/en/history/)
3.  Dhul-Qarnayn: The Just King Who Travelled East and West

# Dhul-Qarnayn: The Just King Who Travelled East and West

Written by **Islam Is Mercy Editorial Team**· 5 min readAwaiting scholar review

## The short answer

Dhul-Qarnayn (‘the one with two horns’) is a righteous ruler described in Surah al-Kahf (18:83-98). God gave him power and the means to travel far to the west and the east; he dealt justly with the peoples he met and built a great barrier to protect a people from Gog and Magog. His exact identity is debated, but the Qur'an's focus is clear: power is a trust from God, to be used with justice and humility.

## On this page

1.  A question, and an answer
2.  Justice in the west and the east
3.  The barrier against Gog and Magog
4.  Who was he?
5.  What Dhul-Qarnayn teaches

History is full of conquerors. Most are remembered for the cities they burned and the peoples they enslaved. The [Qur’an](https://islamismercy.com/en/glossary/quran/) tells the story of a very different kind of ruler: a man with immense power who used it to protect the weak, who refused to be paid for doing good, and who, at the height of his achievement, gave all the credit to God. His title is Dhul-Qarnayn, “the one with two horns,” and his story closes [Surah](https://islamismercy.com/en/glossary/surah/) al-Kahf (Qur’an 18:83-98).

## A question, and an answer

The story begins as a reply to a question that people put to the Prophet Muhammad ﷺ:

> وَيَسْـَٔلُونَكَ عَن ذِى ٱلْقَرْنَيْنِ ۖ قُلْ سَأَتْلُوا۟ عَلَيْكُم مِّنْهُ ذِكْرًا ﴿٨٣﴾ إِنَّا مَكَّنَّا لَهُۥ فِى ٱلْأَرْضِ وَءَاتَيْنَٰهُ مِن كُلِّ شَىْءٍۢ سَبَبًۭا ﴿٨٤﴾

> 83And they ask you, \[O Muhammad\], about Dhul-Qarnayn. Say, "I will recite to you about him a report." 84Indeed We established him upon the earth, and We gave him to everything a way.

[Qur'an, Al-Kahf 18:83-84](https://quran.com/18?startingVerse=83&translations=20)Saheeh International

Notice how the Qur’an introduces him. It does not list his armies or his victories. It says that God *established* him in the land and gave him the way to reach whatever he needed. From the first line, his power is presented as a gift from God, not something he seized for himself.

Scholars differ on whether he was a prophet or a righteous king, and most hold that he was a righteous ruler whom God guided. Commentators also offer different explanations of his title: some link the “two horns” to his reaching the two ends of the earth, east and west; others to features of his crown or appearance. The Qur’an itself does not explain it.

## Justice in the west and the east

Dhul-Qarnayn first travelled west until he reached the farthest point he could go, where the sun appeared to him to set into a dark, murky spring. Classical commentators explain that this describes the scene as he saw it, as a traveller standing at the edge of the sea sees the sun sink into the water. There he found a people, and God gave him a choice about how to deal with them:

> حَتَّىٰٓ إِذَا بَلَغَ مَغْرِبَ ٱلشَّمْسِ وَجَدَهَا تَغْرُبُ فِى عَيْنٍ حَمِئَةٍۢ وَوَجَدَ عِندَهَا قَوْمًۭا ۗ قُلْنَا يَٰذَا ٱلْقَرْنَيْنِ إِمَّآ أَن تُعَذِّبَ وَإِمَّآ أَن تَتَّخِذَ فِيهِمْ حُسْنًۭا ﴿٨٦﴾ قَالَ أَمَّا مَن ظَلَمَ فَسَوْفَ نُعَذِّبُهُۥ ثُمَّ يُرَدُّ إِلَىٰ رَبِّهِۦ فَيُعَذِّبُهُۥ عَذَابًۭا نُّكْرًۭا ﴿٨٧﴾ وَأَمَّا مَنْ ءَامَنَ وَعَمِلَ صَٰلِحًۭا فَلَهُۥ جَزَآءً ٱلْحُسْنَىٰ ۖ وَسَنَقُولُ لَهُۥ مِنْ أَمْرِنَا يُسْرًۭا ﴿٨٨﴾

> 86Until, when he reached the setting of the sun, he found it \[as if\] setting in a spring of dark mud, and he found near it a people. Allah said, "O Dhul-Qarnayn, either you punish \[them\] or else adopt among them \[a way of\] goodness." 87He said, "As for one who wrongs, we will punish him. Then he will be returned to his Lord, and He will punish him with a terrible punishment. 88But as for one who believes and does righteousness, he will have a reward of Paradise, and we will speak to him from our command with ease."

[Qur'an, Al-Kahf 18:86-88](https://quran.com/18?startingVerse=86&translations=20)Saheeh International

His reply is a short charter of just government. Whoever does wrong will be held to account, first by him and then by God. Whoever believes and does good will be treated kindly and given an easy command. He did not treat the whole people as conquered subjects; he distinguished between the oppressor and the righteous.

He then travelled east, to a people who had no shelter from the sun (Qur’an 18:89-91). The Qur’an does not linger on this journey, simply reminding us that God was fully aware of all that he did.

## The barrier against Gog and Magog

His third journey brought him between two mountains, to a people who could barely understand his language. They had a desperate problem: their land was raided by Gog and Magog (*Ya’juj and Ma’juj*), who spread corruption on the earth. They offered to pay him tribute if he would build a barrier for them.

> قَالُوا۟ يَٰذَا ٱلْقَرْنَيْنِ إِنَّ يَأْجُوجَ وَمَأْجُوجَ مُفْسِدُونَ فِى ٱلْأَرْضِ فَهَلْ نَجْعَلُ لَكَ خَرْجًا عَلَىٰٓ أَن تَجْعَلَ بَيْنَنَا وَبَيْنَهُمْ سَدًّۭا ﴿٩٤﴾ قَالَ مَا مَكَّنِّى فِيهِ رَبِّى خَيْرٌۭ فَأَعِينُونِى بِقُوَّةٍ أَجْعَلْ بَيْنَكُمْ وَبَيْنَهُمْ رَدْمًا ﴿٩٥﴾

> 94They said, "O Dhul-Qarnayn, indeed Gog and Magog are \[great\] corrupters in the land. So may we assign for you an expenditure that you might make between us and them a barrier?" 95He said, "That in which my Lord has established me is better \[than what you offer\], but assist me with strength; I will make between you and them a dam.

[Qur'an, Al-Kahf 18:94-95](https://quran.com/18?startingVerse=94&translations=20)Saheeh International

Here we see his character clearly. He refused their money: what God had given him was better. He asked only for their labour, so the project would be shared. Together they filled the gap between the mountains with blocks of iron, heated them until they glowed, and poured molten copper over them (Qur’an 18:96). The result was a wall that Gog and Magog could not get over or break through (Qur’an 18:97).

Then, at the moment of his greatest engineering triumph, Dhul-Qarnayn said this:

> قَالَ هَٰذَا رَحْمَةٌۭ مِّن رَّبِّى ۖ فَإِذَا جَآءَ وَعْدُ رَبِّى جَعَلَهُۥ دَكَّآءَ ۖ وَكَانَ وَعْدُ رَبِّى حَقًّۭا ﴿٩٨﴾

> \[Dhul-Qarnayn\] said, "This is a mercy from my Lord; but when the promise of my Lord comes, He will make it level, and ever is the promise of my Lord true."

[Qur'an, Al-Kahf 18:98](https://quran.com/18?startingVerse=98&translations=20)Saheeh International

There is no boasting here. He calls the barrier a mercy from his Lord, and says it will last only until God decrees its end. Gog and Magog are mentioned again elsewhere in the Qur’an (Qur’an 21:96) as part of the events near the end of time, and names like Gog and Magog also appear in the Bible (for example Ezekiel 38–39 and Revelation 20:8). The Qur’an does not tell us where the barrier stands, and Muslims are wise not to make firm claims about its location.

## Who was he?

Many people naturally want to know which historical figure Dhul-Qarnayn was. Here honesty requires caution. Over the centuries, different answers have been suggested. Some older writers identified him with Alexander the Great, though many classical scholars, such as Ibn Kathir, rejected this, since the Macedonian Alexander was not known as a believer in the One God. Some have proposed an ancient king of Yemen. In modern times, several scholars have suggested Cyrus the Great, the Persian king remembered in the Bible as a liberator who allowed exiled Jews to return home and rebuild their temple (Ezra 1:1-4); they point out that he ruled an empire stretching far to the west and east and was famous for treating conquered peoples mercifully.

None of these identifications is certain, and the Qur’an does not name him. That silence is itself instructive. The Qur’an is not a history textbook; it tells stories for guidance (Qur’an 12:111). What matters is not his name but his example.

## What Dhul-Qarnayn teaches

His story is a mirror held up to everyone who has power, whether over a country, a company or a family:

-   **Power is a trust.** God gave him the means; he never forgot where they came from.
-   **Justice distinguishes.** He punished wrongdoers and honoured the righteous, rather than oppressing everyone alike. Read more in [Justice in Islam](https://islamismercy.com/en/views/justice-in-islam/).
-   **Service is not for sale.** He helped the vulnerable without exploiting their need.
-   **Success calls for humility.** At his greatest moment, he said that it was a mercy from his Lord. See [Humility in Islam](https://islamismercy.com/en/views/humility-in-islam/).

Placed in the same chapter as the [People of the Cave](https://islamismercy.com/en/history/people-of-the-cave/), his story completes a picture: God protects the powerless who hold to faith, and God gives power to those who will use it justly. Both are reminders of one of the patterns of God in history, explored in [History in the Qur’an](https://islamismercy.com/en/history/history-in-the-quran/): arrogance and injustice do not last, while gratitude and faith are honoured.

## Key takeaways

-   Dhul-Qarnayn was a ruler to whom God gave great power and the means to reach distant lands.
-   He punished wrongdoers and rewarded those who believed and did good, and he refused payment for helping the weak.
-   He built a barrier against Gog and Magog and attributed his achievement to God's mercy, not his own genius.
-   His identity is debated (some suggest Cyrus the Great, others another king); the Qur'an's focus is the model of just power.

## Share this article

[WhatsApp](https://wa.me/?text=Dhul-Qarnayn%3A%20The%20Just%20King%20Who%20Travelled%20East%20and%20West%20https%3A%2F%2Fislamismercy.com%2Fen%2Fhistory%2Fdhul-qarnayn%2F)[Telegram](https://t.me/share/url?url=https%3A%2F%2Fislamismercy.com%2Fen%2Fhistory%2Fdhul-qarnayn%2F&text=Dhul-Qarnayn%3A%20The%20Just%20King%20Who%20Travelled%20East%20and%20West)[X](https://twitter.com/intent/tweet?text=Dhul-Qarnayn%3A%20The%20Just%20King%20Who%20Travelled%20East%20and%20West&url=https%3A%2F%2Fislamismercy.com%2Fen%2Fhistory%2Fdhul-qarnayn%2F)[Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fislamismercy.com%2Fen%2Fhistory%2Fdhul-qarnayn%2F)

## Sources

-   [Qur'an, Al-Kahf 18:83-84](https://quran.com/18?startingVerse=83&translations=20)
-   [Qur'an, Al-Kahf 18:86-88](https://quran.com/18?startingVerse=86&translations=20)
-   [Qur'an, Al-Kahf 18:94-95](https://quran.com/18?startingVerse=94&translations=20)
-   [Qur'an, Al-Kahf 18:98](https://quran.com/18?startingVerse=98&translations=20)

## Talk to a Muslim

Have a question that isn't answered here? Ask a real person — no pressure, no judgement.

[Ask your question](https://islamismercy.com/en/talk/)

[The Journey](https://islamismercy.com/en/journey/)·Chapter 19 of 26·Faith tested

[Previous chapter**The People of the Cave: Faith That Outlasted an Empire**](https://islamismercy.com/en/history/people-of-the-cave/)[Next chapter**The People of the Ditch: Faith Under Fire**](https://islamismercy.com/en/history/people-of-the-ditch/)

## Keep reading

[History in the Qur’an

### History in the Qur'an: Why It Tells the Stories of Nations

Why the Qur'an tells the stories of past nations as lessons rather than a chronicle, and the patterns that repeat across every story.

Read article](https://islamismercy.com/en/history/history-in-the-quran/)[History in the Qur’an

### The People of the Cave: Faith That Outlasted an Empire

The Qur'an's story of young believers who fled persecution, slept in a cave for 309 years, and woke to a changed world, and what it teaches.

Read article](https://islamismercy.com/en/history/people-of-the-cave/)[Islam's View On…

### What Does Islam Say About Justice?

Justice is a command of God in Islam — owed to everyone, rich or poor, friend or enemy, even when it goes against yourself or your own family.

Read article](https://islamismercy.com/en/views/justice-in-islam/)[Islam's View On…

### What Does Islam Teach About Humility and Pride?

Islam treats arrogance as a serious spiritual disease and humility as a mark of true greatness. Learn how the Qur'an and the Prophet ﷺ define both.

Read article](https://islamismercy.com/en/views/humility-in-islam/)
