Sahih al-Bukhari 74
Ibn ʿAbbās (r.a) narrated that he differed with al-Ḥurr ibn Qais ibn Ḥiṣn al-Fazārī about the companion of Moses. Ibn ʿAbbās said that it was al-Khaḍir. Ubayy ibn Kaʿb (r.a) happened to pass by, and Ibn ʿAbbās (r.a) called him and said: ‘I have differed with this friend of mine about the companion of Moses whom Moses sought to meet. Have you heard the Prophet (saw) mentioning anything about this matter?’ He said: ‘Yes, I heard the Messenger of Allāh (saw) saying: “Once when Moses (as) was sitting amongst the chiefs of the Israelites, a man came to him and asked: ‘Do you know anyone who is more learned than you?’ Moses (as) replied: ‘No.’ So Allāh revealed to Moses (as): ‘Certainly [there is]. Our servant al-Khaḍir [is more learned than you].’ Moses (as) sought directions to meet him. So, Allāh made the fish a sign for him, and it was said to him: ‘When you lose the fish, go back [to where you lost it] and you will encounter him [al-Khaḍir].’ So, he followed the signs of the fish in the sea. The young companion of Moses (as) said to him: ‘Did you see, when we betook ourselves to the rock for rest, and I forgot the fish – and none but Satan caused me to forget to mention it to you’ (Sūrat al-Kahf, 18:64). He said: ‘That is what we have been seeking.’ So, they both returned, retracing their footsteps (Sūrat al-Kahf, 18:65). Then they found al-Khaḍir and their story has been narrated by Allāh, the Mighty, the Majestic, in His Book’.”’
Translation: Ahmadiyya Muslim Jamaat