"And you would have imagined them to be awake as they slept on. And we would turn them from right side to left, as their dog spread its paws across the entrance. If only you had seen them, you would have turned and fled from them, filled with the terror of them."
"They shall say: ‘They were three in number, their dog a fourth.’ Others will say: ‘They were five in number, their dog a sixth’ – predicting the Unseen. Yet others will say: ’Seven, their dog an eighth.’
Say: ‘My Lord knows best what their number was, and none knows it but a few.’ So do not dispute this issue with them except in a superficial manner, and do not solicit the opinion of any of them concerning their number."
The Cave, Surah 18, verses 18 and 22.
In the Surah Al Kahf (The Cave), a faithful dog is mentioned, accompanying a group of youths in the story of People of the Cave, protecting them as they sleep for more than 300 years. They were concealed and saved from those who were after them.
As described in verse 18, whenever people passed by the cave, it looked as if the dog was just keeping watch at the entrance, making them afraid to look inside. Those who slept: "Were youths who believed in their Lord" (18:13) and were hiding from persecution for their belief in the oneness of Allah and rejection of worshipping many idols. They saw what their elders and majority of the people of their town refused to accept and embrace.
Scholars have drawn similarities between the story of "Ashab el Kahf" (the Sleepers of the Cave) to that in the Christian tradition known as Seven Sleepers of Ephesus, which refers to a group of Christian youths who hid inside a cave outside the city of Ephesus around 250 AD, to escape persecution by the Roman emperor Decius.
It is said that these verses were revealed to Prophet Mohammed to comfort and encourage persecuted Muslims and to show them how righteous people are protected and keep faith.
"And We strengthened their hearts when they rose up, saying ‘Our Lord, Lord of the heavens and earth! We shall call up no other god besides Him, else we utter a falsehood."(18:14)
In the same way when the Prophet and his companion Abu Bakr (the first Caliph) sought refuge in the Cave of Jabal Thawr in Mecca, those in pursuit from Qurayesh could not find them even though they passed right by their hiding spot.
Of that occasion, Surah 9, Repentence, verse 40, says of the Prophet: "If you do not rally to his support, God has already supported him when the unbelievers drove him out, one of two men in a cave.
"It was then that he said to his companion: ‘Do not grieve, for God is with us.’
"Then God made His serenity descend upon him and backed him with troops you did not see. Thus He abased the word of the unbelievers, and the Word of God was supreme. God is Almighty, All-Wise."
It is also widely told in Islam narrations that Allah sent a spider and two doves to conceal the Prophet. The spider spun a delicate web across the entrance to make it appear that no one had entered the cave in a long time.
A dove sat at the entrance nesting with her mate near.
Together, they made it appear that no one had passed through the spot.
Abu Bakr, who feared being discovered, understood from the Prophet’s words that the power of Allah can manifest in the least expected places and ways. A tiny, fragile spider spinning a web of concealment and a nesting dove together were mightier than an army.
It was the same case with the people of the cave and their dog, who was sent to conceal and be their guard for hundreds of years.
Islam’s reverence for the faithful dog is implied in the Quran through this story, and there is no reference to them as "najes" or unclean in the Quran.
"So eat what they catch and mention the name of God thereon, and fear God." (Surah Al Ma’idah (The Table, Surah 5, verse 5).
Every story in the Quran, including those of animals, has examples and lessons for its readers and believers.
(All English translations are taken from The Qur’an, a New Translation by Tarif Khalidi, the Sheikh Zayid Chair in Islamic and Arabic Studies at the American University of Beirut, published by Penguin Classics)