Who is al-Khidr?
Al-Khidr or Khidr is described but his name is not explicitly mentioned in the Holy Quran. Some people regard al-Khidr as a prophet. In Quran 18:65-82, al-Khidr is described as the Servant of God with Knowledge. In many texts, Khidr is described as a messenger, prophet, angel who guards the sea, helps those in distress and imparts secret knowledge.
What does the Quran say about al-Khidr?
In Surah Al-Kahaf (65-82), it is stated that Moses meets the Servant of God who has the secret knowledge. Both of them met at the junction of two seas (Majma' al-Bahrayn ) and Moses seeks permission from al-Khidr to learn the secret knowledge imparted to him. Al-Khidr told Moses that he won't be able to have patience with him to which the latter promised to obey unquestioningly. Upon this agreement, both of them boarded the ship. A few moments later, al-Khidr damages the vessel and Moses questioned him by saying, 'Have you made a hole in it to drown its inmates? Certainly, you have done a grievous thing.' Al-Khidr reminded Moses of his warning (Moses won't be able to have patience with him) to which he pleads not to be rebuked.
Al-Khidr now kills a young man and Moses again cried in astonishment and dismay. Al-Khidr again reminded Moses about his warning and Moses promised to not break his oath.
Next, al-Khidr and Moses proceed to a town but were denied hospitality. To this, al-Khidr restores a decrepit wall in the town. Moses was amazed and violated his promise again.
To this, al-Khidr stated that this violation marks their separation and now the questions will be answered. Al-Khidr stated that many acts seem to be evil but are actually merciful. The boat was damaged to prevent the inmates from falling into the hands of the king, who seized every boat with the help of his force. The young man was killed as his parents were believers but he could make disobedience and ingratitude to come upon them. He further stated that God will replace the young man with purity, affection and obedience. The wall was restored because underneath the wall, the treasure belonging to two helpless orphans was stored and their father was a righteous man. When the two orphans will become older and stronger and the wall will become weak again, they will be able to take the treasure that belongs to them.
It must be noted that the name of the Servant of God (al-Khidr) is nowhere mentioned in the Holy Quran. Also, there is no reference to him about being immortal in the Quran.
What Hadith states about al-Khidr?
In Al-Zuhd, Ahmad ibn Hanbal narrates that as per Prophet Muhammad, that Prophet Elijah and al-Khidr meet every year to spend the holy month of Ramadan in Jerusalem. The other narration by Ya'qub ibn Sufyan (as stated by Umar ibn Abd al-Aziz) states that a man he was seen walking was actually al-Khidr. Another narration states that Abu Zur’ a al-Razi met al-Khidr twice-- one in his youth and other in his old age-- but al-Khidr did not change.
Several texts state that al-Khidr has an appearance of young adult but he has a long white beard. As per Imam al-Bukhari, a ground on which Servant of God was standing became green due to his presence.
Another narration states that al-Khidr and Ali met at the Kaaba and instructed Ali about the supplication which is meritorious when recited after the obligatory prayers.
In Kitab al-Kafi, Ja'far al-Sadiq narrated that after entering the Mosque in Mecca-- Ali, Hasan ibn Ali and Husayn ibn Ali-- were visited by a good looking man who asked them a series of questions. Hasan answered the questions. The man testified the Prophet-hood of Muhammad and testified Ali and his Ahl al-Bayt (Family) to be the successors and heir to the message. Ali asked Hasan to track the visitor at which he failed. After this, Ali identified this man as al-Khidr.
Several Islamic perspectives on al-Khidr:
As per Shia Muslims and hadith, al Khidr accompanied Muhammad al-Mahdi (last Imam) in a meeting in 984 CE (17 Ramadan 373 A.H.) and instructed him to build Jamkaran Mosque at the site where they met. The mosque is situated in Qom, Iran and is visited by Shia Muslims. Many Shia Muslims are of the view that al-Khidr is the permanent Imam who has guided people throughout history.
Another hadith states that al-Khidr appeared as a tall, sturdy man with white thick beard to Prophet Muhammad and 'Ali while they were crossing an alley in Medina. Other hadiths state that al-Khidr offered his condolences on the demise of the Prophet Muhammad.
As per Sunni Muslims and hadiths, ibn 'Abbas had an argument with another person about the identity of the master of Moses. To figure this out, both of them went to Ubayy b. Ka'b. Ubayy b. Ka'b narrated ( a remark by Prophet Muhammad) that someone went to Moses and asked if he knew anyone more knowledgeable and wiser than himself, to which Moses denied. After this, God revealed to Moses that his servant, al-Khidr is wiser and knowledgeable than him. Moses asked God how to meet al-Khidr to which God specified a fish as a sign. Later, Moses met al-Khidr at Majma' al-Bahrayn.
Ahmadiyya Muslims believe that al-Khidr is none other than Prophet Muhammad himself. Ahmadis believe that the story cited in Surah al-Kahf (Moses journey towards al-Khidr and his experience with him) is not physical but is similar to Mi'raj of the Prophet Muhammad.
Ahmadiyyas are of the view that at several places in the Quran, Muhammad is referred to as the 'Servant of God'. Thus, al-Khidr (Servant of God) is none other than Prophet Muhammad himself.