Khidr and Musa: The Full Story From Sahih al-Bukhari
Contents
Who was Khidr, and what really happened when Prophet Musa travelled to learn from him? Surah al-Kahf tells the story in 23 verses (18:60–82). The Prophet ﷺ told it too, with details the Quran leaves out: why Musa set off, the fish in the basket, a sparrow on the edge of a boat. Here is the full story of Musa and al-Khidr from Sahih al-Bukhari, scene by scene, with what each part teaches.
At a glance
- Source: Sahih al-Bukhari 3401 and Sahih Muslim 2380a
- Narrated by: Ubayy ibn Ka‘b (may Allah be pleased with him), through Ibn ‘Abbas
- Grade: Sahih (in both Bukhari and Muslim)
- Topic: Khidr in Islam, seeking knowledge, patience with Allah’s decree
- Practise it: When asked something you do not fully know, say “Allah knows best”
Khidr and Musa: “Who is the most learned?”
Sa‘id ibn Jubayr reported that Ibn ‘Abbas told him this story from Ubayy ibn Ka‘b (may Allah be pleased with them), who heard it from the Prophet ﷺ. It begins with a question put to Musa after a sermon:
مُوسَى قَامَ خَطِيبًا فِي بَنِي إِسْرَائِيلَ، فَسُئِلَ أَىُّ النَّاسِ أَعْلَمُ فَقَالَ أَنَا. فَعَتَبَ اللَّهُ عَلَيْهِ إِذْ لَمْ يَرُدَّ الْعِلْمَ إِلَيْهِ. فَقَالَ لَهُ بَلَى، لِي عَبْدٌ بِمَجْمَعِ الْبَحْرَيْنِ هُوَ أَعْلَمُ مِنْكَ. قَالَ أَىْ رَبِّ وَمَنْ لِي بِهِ
“Musa stood up to address the Children of Israel, and he was asked: ‘Who is the most learned of the people?’ He said: ‘I am.’ Allah admonished him because he did not refer the knowledge back to Him, and said to him: ‘Yes (there is someone more learned): I have a servant at the junction of the two seas who is more learned than you.’ Musa said: ‘O my Lord, how can I reach him?’”
Sahih al-Bukhari 3401 (also Muslim 2380a) · Narrated by Ubayy ibn Ka‘b · Translation adapted from Sunnah.com
Musa was not lying: he was a great prophet who spoke with Allah. But he answered without saying “Allah knows best”, and Allah taught him, and us, a lesson. Allah then told him how to find this servant:
قَالَ تَأْخُذُ حُوتًا، فَتَجْعَلُهُ فِي مِكْتَلٍ، حَيْثُمَا فَقَدْتَ الْحُوتَ فَهْوَ ثَمَّ
“(Allah) said: ‘Take a fish and put it in a basket. Wherever you lose the fish, he will be there.’”
Sahih al-Bukhari 3401 (also Muslim 2380a) · Narrated by Ubayy ibn Ka‘b · Translation adapted from Sunnah.com
Musa set off with his young servant, Yusha‘ ibn Nun. While Musa slept by a rock, the fish slipped out of the basket into the sea, and Allah held the water back so its path stayed open like a tunnel. Yusha‘ forgot to mention it until the next day, when Musa asked for their meal. “That is what we were looking for,” Musa said, and they walked back to the rock.
Meeting al-Khidr
فَإِذَا رَجُلٌ مُسَجًّى بِثَوْبٍ، فَسَلَّمَ مُوسَى، فَرَدَّ عَلَيْهِ. فَقَالَ وَأَنَّى بِأَرْضِكَ السَّلاَمُ. قَالَ أَنَا مُوسَى. قَالَ مُوسَى بَنِي إِسْرَائِيلَ قَالَ نَعَمْ، أَتَيْتُكَ لِتُعَلِّمَنِي مِمَّا عُلِّمْتَ رَشَدًا. قَالَ يَا مُوسَى إِنِّي عَلَى عِلْمٍ مِنْ عِلْمِ اللَّهِ، عَلَّمَنِيهِ اللَّهُ لاَ تَعْلَمُهُ وَأَنْتَ عَلَى عِلْمٍ مِنْ عِلْمِ اللَّهِ عَلَّمَكَهُ اللَّهُ لاَ أَعْلَمُهُ
“There was a man covered with a garment. Musa greeted him with salam and he returned it, then said: ‘Where is there salam in your land?’ He said: ‘I am Musa.’ He asked: ‘Musa of the Children of Israel?’ He said: ‘Yes. I have come to you so that you may teach me some of the right guidance you have been taught.’ He said: ‘O Musa, I have some of the knowledge of Allah which Allah has taught me and which you do not know, and you have some of the knowledge of Allah which Allah has taught you and which I do not know.’”
Sahih al-Bukhari 3401 (also Muslim 2380a) · Narrated by Ubayy ibn Ka‘b · Translation adapted from Sunnah.com
The Quran describes him in the same scene, without giving his name:
فَوَجَدَا عَبْدًا مِّنْ عِبَادِنَآ ءَاتَيْنَـٰهُ رَحْمَةً مِّنْ عِندِنَا وَعَلَّمْنَـٰهُ مِن لَّدُنَّا عِلْمًا
“And they found a servant from among Our servants [i.e., al-Khiḍr] to whom We had given mercy from Us and had taught him from Us a [certain] knowledge.”
Surah al-Kahf 18:65 · Translation: Saheeh International, from Quran.com
His name comes from the Sunnah. Abu Hurairah (may Allah be pleased with him) reported that the Prophet ﷺ said:
إِنَّمَا سُمِّيَ الْخَضِرُ أَنَّهُ جَلَسَ عَلَى فَرْوَةٍ بَيْضَاءَ فَإِذَا هِيَ تَهْتَزُّ مِنْ خَلْفِهِ خَضْرَاءَ
“Al-Khidr was given his name because he sat on a patch of dry white land, and it suddenly turned green, rippling with plants behind him.”
Sahih al-Bukhari 3402 · Narrated by Abu Hurairah · Translation adapted from Sunnah.com
Al-Khidr means “the green one”. Musa asked to follow him, and al-Khidr warned him that he would not be able to stay patient with things he did not understand. Musa promised he would, if Allah willed.
The boat and the sparrow
فَانْطَلَقَا يَمْشِيَانِ عَلَى سَاحِلِ الْبَحْرِ، فَمَرَّتْ بِهِمَا سَفِينَةٌ، كَلَّمُوهُمْ أَنْ يَحْمِلُوهُمْ، فَعَرَفُوا الْخَضِرَ، فَحَمَلُوهُ بِغَيْرِ نَوْلٍ، فَلَمَّا رَكِبَا فِي السَّفِينَةِ جَاءَ عُصْفُورٌ، فَوَقَعَ عَلَى حَرْفِ السَّفِينَةِ، فَنَقَرَ فِي الْبَحْرِ نَقْرَةً أَوْ نَقْرَتَيْنِ، قَالَ لَهُ الْخَضِرُ يَا مُوسَى، مَا نَقَصَ عِلْمِي وَعِلْمُكَ مِنْ عِلْمِ اللَّهِ إِلاَّ مِثْلَ مَا نَقَصَ هَذَا الْعُصْفُورُ بِمِنْقَارِهِ مِنَ الْبَحْرِ
“So they set off walking along the seashore. A boat passed by them, and they spoke to the crew to take them on board. The crew recognised al-Khidr and carried them without fare. When they had boarded the boat, a sparrow came, landed on the edge of the boat and pecked once or twice in the sea. Al-Khidr said to him: ‘O Musa, my knowledge and your knowledge have taken from the knowledge of Allah only as much as this sparrow has taken from the sea with its beak.’”
Sahih al-Bukhari 3401 (also Muslim 2380a) · Narrated by Ubayy ibn Ka‘b · Translation adapted from Sunnah.com
Two of the most learned people on earth, and all their knowledge together is a beakful of water from the sea. The scene is a gentle reply to Musa’s “I am”.
إِذْ أَخَذَ الْفَأْسَ فَنَزَعَ لَوْحًا، قَالَ فَلَمْ يَفْجَأْ مُوسَى إِلاَّ وَقَدْ قَلَعَ لَوْحًا بِالْقَدُّومِ. فَقَالَ لَهُ مُوسَى مَا صَنَعْتَ قَوْمٌ حَمَلُونَا بِغَيْرِ نَوْلٍ، عَمَدْتَ إِلَى سَفِينَتِهِمْ فَخَرَقْتَهَا لِتُغْرِقَ أَهْلَهَا، لَقَدْ جِئْتَ شَيْئًا إِمْرًا. قَالَ أَلَمْ أَقُلْ إِنَّكَ لَنْ تَسْتَطِيعَ مَعِيَ صَبْرًا. قَالَ لاَ تُؤَاخِذْنِي بِمَا نَسِيتُ وَلاَ تُرْهِقْنِي مِنْ أَمْرِي عُسْرًا، فَكَانَتِ الأُولَى مِنْ مُوسَى نِسْيَانًا
“Then he took the adze and pulled out a plank. Musa only noticed when he had already pulled out a plank with the adze. Musa said to him: ‘What have you done? These people carried us without fare, and you deliberately made a hole in their boat to drown its people. You have done something grave.’ He said: ‘Did I not tell you that you would never be able to have patience with me?’ Musa said: ‘Do not blame me for what I forgot, and do not be hard on me in my affair.’ So the first (objection) from Musa was out of forgetfulness.”
Sahih al-Bukhari 3401 (also Muslim 2380a) · Narrated by Ubayy ibn Ka‘b · Translation adapted from Sunnah.com
Musa’s first objection came from forgetting his promise, and al-Khidr let it pass. The next test was much harder.
The boy
After they left the boat, they passed a boy playing with other boys, and al-Khidr took hold of him and killed him (the Quran tells this in 18:74).
فَقَالَ لَهُ مُوسَى أَقَتَلْتَ نَفْسًا زَكِيَّةً بِغَيْرِ نَفْسٍ لَقَدْ جِئْتَ شَيْئًا نُكْرًا. قَالَ أَلَمْ أَقُلْ لَكَ إِنَّكَ لَنْ تَسْتَطِيعَ مَعِيَ صَبْرًا. قَالَ إِنْ سَأَلْتُكَ عَنْ شَىْءٍ بَعْدَهَا فَلاَ تُصَاحِبْنِي، قَدْ بَلَغْتَ مِنْ لَدُنِّي عُذْرًا
“Musa said to him: ‘Have you killed a pure soul who had killed no one? You have done something terrible.’ He said: ‘Did I not tell you that you would never be able to have patience with me?’ Musa said: ‘If I ask you about anything after this, do not keep me in your company. You have received from me an excuse.’”
Sahih al-Bukhari 3401 (also Muslim 2380a) · Narrated by Ubayy ibn Ka‘b · Translation adapted from Sunnah.com
This is the hardest part of the story, and the Quran gives its reason a few verses later. Al-Khidr acted on Allah’s command, with knowledge of the unseen that no one else has. The story is not a rule for anyone to follow.
The wall in the unfriendly village
فَانْطَلَقَا حَتَّى إِذَا أَتَيَا أَهْلَ قَرْيَةٍ اسْتَطْعَمَا أَهْلَهَا فَأَبَوْا أَنْ يُضَيِّفُوهُمَا فَوَجَدَا فِيهَا جِدَارًا يُرِيدُ أَنْ يَنْقَضَّ
“So they went on until they came to the people of a village. They asked its people for food, but they refused to host them. Then they found in it a wall that was about to collapse.”
Sahih al-Bukhari 3401 (also Muslim 2380a) · Narrated by Ubayy ibn Ka‘b · Translation adapted from Sunnah.com
Al-Khidr straightened the wall with his own hands, for people who had refused them even a meal.
قَالَ قَوْمٌ أَتَيْنَاهُمْ فَلَمْ يُطْعِمُونَا وَلَمْ يُضَيِّفُونَا عَمَدْتَ إِلَى حَائِطِهِمْ لَوْ شِئْتَ لاَتَّخَذْتَ عَلَيْهِ أَجْرًا. قَالَ هَذَا فِرَاقُ بَيْنِي وَبَيْنِكَ، سَأُنَبِّئُكَ بِتَأْوِيلِ مَا لَمْ تَسْتَطِعْ عَلَيْهِ صَبْرًا
“(Musa) said: ‘These are people we came to, and they neither fed us nor hosted us, yet you went and (repaired) their wall. If you had wished, you could have taken payment for it.’ He said: ‘This is the parting between me and you. I will tell you the meaning of what you could not bear with patience.’”
Sahih al-Bukhari 3401 (also Muslim 2380a) · Narrated by Ubayy ibn Ka‘b · Translation adapted from Sunnah.com
That was Musa’s third objection, and the end of the journey together.
Why al-Khidr did what he did
Before they parted, al-Khidr explained all three acts (18:79–82). He damaged the boat because a king was seizing every sound ship, and a damaged boat would be left for its poor owners. The boy would have grown up to burden his believing parents with defiance and disbelief, and Allah would give them a better child in his place. And the wall:
وَأَمَّا ٱلْجِدَارُ فَكَانَ لِغُلَـٰمَيْنِ يَتِيمَيْنِ فِى ٱلْمَدِينَةِ وَكَانَ تَحْتَهُۥ كَنزٌ لَّهُمَا وَكَانَ أَبُوهُمَا صَـٰلِحًا فَأَرَادَ رَبُّكَ أَن يَبْلُغَآ أَشُدَّهُمَا وَيَسْتَخْرِجَا كَنزَهُمَا رَحْمَةً مِّن رَّبِّكَ ۚ وَمَا فَعَلْتُهُۥ عَنْ أَمْرِى ۚ ذَٰلِكَ تَأْوِيلُ مَا لَمْ تَسْطِع عَّلَيْهِ صَبْرًا
“And as for the wall, it belonged to two orphan boys in the city, and there was beneath it a treasure for them, and their father had been righteous. So your Lord intended that they reach maturity and extract their treasure, as a mercy from your Lord. And I did it not of my own accord. That is the interpretation of that about which you could not have patience.”
Surah al-Kahf 18:82 · Translation: Saheeh International, from Quran.com
“I did it not of my own accord.” Every act came from Allah’s command, and each one was a mercy that looked like harm from the outside.
“We wish Musa had been patient”
After telling the story, the Prophet ﷺ added a line of his own:
قَالَ النَّبِيُّ صلى الله عليه وسلم وَدِدْنَا أَنَّ مُوسَى كَانَ صَبَرَ، فَقَصَّ اللَّهُ عَلَيْنَا مِنْ خَبَرِهِمَا
“The Prophet ﷺ said: ‘We wish that Musa had been patient, so that Allah would have told us more of their story.’”
Sahih al-Bukhari 3401 (also Muslim 2380a) · Narrated by Ubayy ibn Ka‘b · Translation adapted from Sunnah.com
We only have the three scenes the Quran and the hadith tell us, and the Prophet ﷺ himself wished there had been more.
What it means
HadeethEnc’s explanation of this hadith draws out its main points: a scholar should refer knowledge back to Allah, a student should travel and be humble for knowledge, and a person should keep his promises and his manners with his teacher (HadeethEnc 8304). Al-Bukhari placed the same hadith in his Book of Knowledge (Bukhari 122), as an example of what a seeker of knowledge should be like.
Reflection: most of us will never see a boat damaged or a wall rebuilt by a man of al-Khidr’s knowledge. But we do see a job lost, a plan blocked, a door closed. The story does not tell us every loss is secretly a gift. It tells us Allah sees what we cannot, and that patience is the right answer when the reason is hidden.
How to practise it
- When asked something you do not fully know, say “Allah knows best” instead of guessing.
- Keep learning from people who know more than you, whatever your age or position.
- Read Surah al-Kahf on Friday, and pause on verses 60–82 to picture these scenes.
- When something goes wrong and you cannot see why, make dua and wait before you judge.
Questions people ask
Was al-Khidr a prophet?
Scholars differ. Ibn Hajar cites Ibn ‘Atiyyah saying that most scholars held he was a prophet, a view also mentioned by al-Qurtubi and an-Nawawi, while others such as al-Qushayri held he was a righteous servant (wali), not a prophet (summary of the views). The hadith itself calls him a servant of Allah.
Is al-Khidr still alive?
Scholars differ here too. Some, including the scholars quoted by IslamQA, hold that he died, using the verse that no human was given immortality (21:34) and the hadith that no one alive on earth that night would remain after a hundred years (Bukhari 116; IslamQA 20505). Others, as Egypt’s Dar al-Ifta quotes from an-Nawawi, held he is alive (Dar al-Ifta). Stories of people meeting him are not authentic hadith.
Why is he called Khidr?
The Prophet ﷺ said he was named al-Khidr (“the green one”) because he sat on dry white land and it turned green with plants behind him (Sahih al-Bukhari 3402).
Key lessons

- Knowledge belongs to Allah: Musa was taught to refer it back to Him.
- All human knowledge is like a sparrow’s beakful taken from the sea.
- Seeking knowledge takes travel, humility and good manners with the teacher.
- Patience is needed most when we cannot see the reason for what happens.
- The Prophet ﷺ wished Musa had stayed patient so we could hear more.
Part of our Prophets in the Hadith series: see all our articles on the prophets in one place.
Next Friday, when you reach the story of Musa and al-Khidr in Surah al-Kahf, picture that sparrow on the edge of the boat. May Allah give us beneficial knowledge, and the patience to trust Him when we do not understand.
Save this to Pinterest so you can come back to the story of Musa and al-Khidr

Share the reward. Send this article to someone who needs it today — teaching a hadith or dua can become a lasting good deed for you, in shaa Allah.






