The from the general meaning of the Qur’aanic verses it appears that he was a Prophet.
Shaykh al-Shanqeeti (may Allaah have mercy on him) said in his commentary on the aayah (interpretation of the meaning)
“Then they found one of Our slaves, on whom We had bestowed mercy from Us, and whom We had taught knowledge from Us”
“But it may be understood from some aayahs that the mercy mentioned here was the mercy of Prophethood, and that this knowledge which came from Allaah was the knowledge of revelation (wahy)… It is known that mercy and the bestowal of knowledge from Allaah is more general and comes in more ways than via Prophethood. The fact that something general exists does not necessarily imply that something more specific exists, as is well known. One of the indications that the mercy and knowledge with which Allaah blessed His slave al-Khidr came by way of Prophethood and revelation is the aayah (interpretation of the meaning):
“And I did them not of my own accord”[al-Kahf 18:82]
i.e., rather I did them by the command of Allaah, and the command of Allaah is only conveyed via wahy (revelation), because there is no way for the commands and prohibitions of Allaah to be known except through revelation from Allaah, especially with regard to the killing of an apparently innocent soul and damaging a ship by making a hole in it, because committing acts of aggression against people’s lives and wealth can only be validated via revelation from Allaah. Allaah has restricted the method of warning to revelation as He says (interpretation of the meaning):
the word innama (translated here as “only”) implies limitation or restriction.
Adwaa’ al-Bayaan, 4/172, 173
And he said:
From all of this we know that al-Khidr’s killing the boy and making a hole in the ship, and his saying,
“And I did them not of my own accord”
[al-Kahf 18:82 – interpretation of the meaning]]
clearly indicate that he was a Prophet. Al-Fakhr al-Raazi, in his tafseer, attributed the view that he was a Prophet to many scholars. Another factor that may indicate that he was a Prophet is the fact that Moosa (peace be upon him) humbled himself before him and said (interpretation of the meaning):
“May I follow you so that you teach me something of that knowledge (guidance and true path) which you have been taught (by Allaah)?”[al-Kahf 18:66]
“If Allaah wills, you will find me patient, and I will not disobey you in aught”[al-Kahf 18:69]
even though al-Khidr said to him (interpretation of the meaning):
“And how can you have patience about a thing which you know not?” [al-Kahf 18:68]
Adwaa’ al-Bayaan, 3/326.