This website uses cookies

Read our Privacy policy and Terms of use for more information.

Pen-and-ink illustration of a small cave among boulders on a bare mountainside under a starry sky

It is late, the house is quiet, and the phone is face down on the table. The scan is booked for Monday. Or the rent is due and the numbers do not reach. Or a message to someone we love has sat unanswered for a week.

We have done what we could, and the outcome is still out of our hands. So we sit and count everything that is against us, and the count always comes out the same: too much of it, and only one of us.

The cave of Thawr is where the Prophet ﷺ answered that fear. He and Abu Bakr, may Allah be pleased with him, were hidden on a mountain outside Makkah with the men hunting them standing at the entrance. What he said there has steadied believers ever since.

In short: The cave of Thawr, on a mountain near Makkah, sheltered the Prophet ﷺ and Abu Bakr for three nights during the Hijrah, the migration to Madinah. With searchers standing above them, the Prophet ﷺ asked what Abu Bakr thought of two whose third is Allah (Sahih al-Bukhari 3653; Qur’an 9:40).

What happened in the cave of Thawr

The cave of Thawr enters the story on the day the Prophet ﷺ was given permission to leave Makkah. The Quraysh were plotting against his life. He ﷺ came to Abu Bakr’s house at noon, an hour he never usually visited, and told him the permission had come. Abu Bakr asked to go with him, and the Prophet ﷺ said yes.

Aishah, may Allah be pleased with her, narrates what followed in a long report in Sahih al-Bukhari 3905. The two of them reached a cave on Mount Thawr and stayed there three nights while the search went on.

Abu Bakr himself tells us the moment that matters. He raised his head and saw the feet of the searchers. He said to the Messenger of Allah ﷺ that if one of them looked down toward his own feet, he would see them both. The Prophet ﷺ replied:

“O Abu Bakr! What do you think of two (persons) the third of whom is Allah?”

That is the whole exchange as Abu Bakr reported it. It is short, and it has never needed anything added to it.

How the Qur’an tells the same moment

Allah Himself preserved this scene. In Surah at-Tawbah, He reminds the believers that He had already helped His Messenger ﷺ when he was driven out as one of two, and He records the words spoken inside the cave:

“Do not grieve; indeed Allah is with us.”

The verse then tells us what Allah did. He sent down His sakinah, a calm that He places in the heart, and He supported His Messenger ﷺ with forces that no one saw. He brought the plan of the disbelievers low, and His word remained the highest.

Notice the order. The words of trust were spoken while the men were still outside. The calm came from Allah, and the help came from Allah. The Prophet ﷺ spoke of Allah’s nearness at the worst moment, with the danger still standing over them, and Allah answered.

Abu Bakr’s fear was the fear of a man who loved

Abu Bakr’s fear deserves a gentle reading. He was the first man to believe and the closest companion, and he was afraid. The Qur’an does not hide it.

The commentary Ma’arif al-Qur’an explains that his worry was for the Prophet ﷺ, that the enemy outside might harm him. This was the grief of someone guarding what he loved most in the world.

This should comfort us. Fear inside our own cave is no proof that our faith has failed. The best of this community after its Prophet ﷺ felt it. What the Prophet ﷺ gave him was a truer way to see the situation, and he gave it with tenderness: do not grieve.

Two, and Allah is their third: how the Prophet ﷺ counted

Two, and Allah is their third. With that question the Prophet ﷺ changed the count.

Abu Bakr had counted the way any of us would. Two men in a small space. Many men outside, and the Quraysh had promised a reward for whoever killed or captured them, as Suraqah ibn Malik relates in Sahih al-Bukhari 3906. By that arithmetic the matter was finished.

The Prophet ﷺ counted again and began with Allah. The Lord who created the mountain, the searchers, and their eyes was present with His help and His care. Once He is in the count, the numbers on the other side stop deciding the outcome.

Allah is with His servants through His knowledge, His support, and His protection. The cave teaches us that this nearness is most real exactly where we feel most alone.

Their trust came after their planning

Their trust sat on top of careful work. Aishah’s report in Sahih al-Bukhari describes the preparation. Abu Bakr had fed two camels for four months in readiness. They hired a skilled guide and arranged for him to bring the camels to the cave after three nights.

Abu Bakr’s son spent his days in Makkah listening to what the Quraysh were planning, and came to the cave after dark with the news.

Amir ibn Fuhayrah, a freedman of Abu Bakr, brought the flock near the cave each night so that they had fresh milk. When they finally set out, the guide took them by the coastal route.

So the Messenger of Allah ﷺ himself planned every step that was his to plan. Tawakkul, reliance on Allah, was never a replacement for that effort. We explore that balance further in tawakkul and tying the camel.

Then came the moment when no plan could help. The searchers were at the entrance and there was nothing left to do. That is where the question was asked. Trust in Allah holds our effort from the beginning, and it carries us alone when effort runs out.

About the spider web and the doves

Many of us grew up hearing that a spider spun its web across the entrance and that two doves nested there. These details are not found in the Qur’an or in the reports of al-Bukhari.

Scholars of hadith have examined the chains of narrators behind these reports, and several of them, including al-Albani, judged those chains weak. Some earlier scholars were more accepting of the spider report, so we mention it with that caution and do not build the story on it. A short summary of the gradings is at Islam Question and Answer.

We lose nothing by setting them aside. What Allah told us is greater: He sent calm into a heart and sent forces no eye could see. The searchers stood close enough for their feet to be seen, and they left.

Bringing the count into our own cave

Each of us has a cave. A diagnosis, a debt, a child we cannot reach, a door that stays shut. The Sunnah of that night can be practiced in a few minutes.

  1. Name the cave. Say plainly, to Allah, what we are afraid of. Abu Bakr said his fear aloud to the Prophet ﷺ, and he was answered with kindness.

  2. Finish what is ours to do. Make the call, book the appointment, write the plan. The camels were fed for four months before the night came. Our piece on seeking treatment alongside du’a walks through the same balance in illness.

  3. Count again, starting with Allah. When the fear rises, say the words from the cave: do not grieve, Allah is with us. They can be said in English, in a whisper, by someone who has not prayed in a long time. In Arabic they are la tahzan, innallaha ma’ana.

  4. Ask for sakinah. Calm is something Allah sends down, so we ask Him for it. One sentence before sleep is enough to begin: O Allah, send Your calm on my heart. Those who pray can ask in sujud, the prostration of prayer.

For more on holding hope while the outcome is unknown, see hope and tawakkul in Islam.

Frequently asked questions about the cave of Thawr

Where is the cave of Thawr?

It is on Mount Thawr, near Makkah. The Prophet ﷺ and Abu Bakr hid there before setting out for Madinah.

How long did the Prophet ﷺ stay in the cave of Thawr?

Three nights, as Aishah narrates in Sahih al-Bukhari 3905. After that the guide brought the two camels and they set out along the coast.

Which verse of the Qur’an mentions the cave?

Surah at-Tawbah 9:40. It mentions the two in the cave, the words “Do not grieve; indeed Allah is with us,” the calm Allah sent down, and the unseen forces.

Is the story of the spider web authentic?

Its chain is disputed and several hadith scholars graded it weak. It does not appear in the Qur’an or in Sahih al-Bukhari, so we tell the story without it.

Why was Abu Bakr afraid in the cave?

Commentators on Qur’an 9:40 explain that his fear was for the safety of the Prophet ﷺ. The Prophet ﷺ answered him gently, telling him not to grieve.

What does “Allah is their third” mean?

It means Allah was with them through His help, His knowledge, and His protection. The phrase speaks of His support for the two servants who relied on Him.

The count that settles the heart

The men outside that cave had numbers and a reward to chase. They went home with nothing. Two men inside had Allah, and they walked out to Madinah, to a community, and to everything that followed.

Our caves are smaller, and the same Lord is with those who turn to Him. Tonight, before sleep, we can name the one thing we are most afraid of, and then say six words over it: do not grieve, Allah is with us. Nothing outside the cave has to change first. The Prophet ﷺ said it while the feet were still at the entrance.