← Back to Lessons
Stories of the Companions

Abu Bakr in the Cave

A spider, a dove, and Allah's protection during the most important journey in Islam.

The Cave of Thawr during the Hijra, where Prophet Muhammad and Abu Bakr hid, with a spider web across the entrance and a dove nesting at the opening
Listen
0:00

The Prophet Muhammad ﷺ had to leave Makkah, and he had to leave that very night. There were people in Makkah who did not like that he was teaching about Allah, and they wanted to hurt him. Allah had told the Prophet ﷺ it was time to go.

The Prophet ﷺ would not travel alone. He chose his closest, most trusted friend to go with him: Abu Bakr. Together, they would travel to a new city called Madinah, where the Muslims would be safe.

But the journey was dangerous. The people who were against them were watching the roads. So instead of leaving in the daytime, the Prophet ﷺ and Abu Bakr left at night, and they went to a place where no one would look for them: a small cave on a mountain called Mount Thawr.

Inside the cave, it was dark and quiet. The Prophet ﷺ and Abu Bakr could hear footsteps outside. The people who were chasing them had reached the mountain. They were walking close to the cave entrance.

Abu Bakr became worried. He whispered to the Prophet ﷺ, "If they look down at their feet, they will see us!" But the Prophet ﷺ stayed calm. He answered softly, "Do not be sad. Allah is with us."

And then something amazing happened. While the Prophet ﷺ and Abu Bakr were inside the cave, Allah sent two of His smallest creatures to help.

A spider spun a beautiful, delicate web across the entrance of the cave. And a dove built a small nest right at the opening and laid her eggs there.

When the people chasing them looked at the cave, they saw the spider's web stretched across the entrance, untouched. They saw the dove sitting peacefully on her eggs.

One of them said, "Nobody has gone into this cave. The web is whole and the bird is calm. If anyone had entered, the web would be torn and the bird would have flown away."

So they turned and walked away.

The Prophet ﷺ and Abu Bakr stayed safely in the cave. After three days, when the danger had passed, they continued their journey to Madinah. They arrived safely, and Madinah became the new home for the Muslims.

A tiny spider. A small dove. That was all Allah needed to protect the two most important travelers in the world.

What this story teaches us

When we feel afraid or worried, we can remember what the Prophet ﷺ said to Abu Bakr in the cave: "Do not be sad. Allah is with us." Allah can use the smallest things, like a spider or a dove, to protect us. We are never alone when we trust Allah.

From the Quran: Surah At-Tawbah (9:40) mentions this exact moment in the cave. The full story is recorded in Sahih al-Bukhari and the major seerah works including those of Ibn Ishaq and Ibn Hisham.

Try it today

The next time you feel scared at night, or worried about something hard, remember what the Prophet ﷺ said to Abu Bakr in that quiet cave: "Allah is with us." It is one of the most comforting things ever said.

Read more lessons

For Parents

Source, context, and how to share this story with your child.

Who was Abu Bakr?

Abu Bakr as-Siddiq was the closest companion of the Prophet Muhammad ﷺ and the first adult man to accept Islam. He was a successful merchant in Makkah and used much of his personal wealth to free enslaved Muslims who were being tortured for their faith, including Bilal ibn Rabah. Abu Bakr earned the title "as-Siddiq," meaning "the truthful one," because he believed the Prophet’s account of the Night Journey (Isra and Mi‘raj) without hesitation when others questioned it. After the Prophet’s passing, Abu Bakr became the first khalifa (caliph) of the Muslims. He is one of the most beloved figures in Islamic history.

What is the Hijra in Islam?

The Hijra is the migration of the Prophet Muhammad ﷺ and his companion Abu Bakr from Makkah to Madinah in 622 CE. This journey was so important in Islamic history that the Islamic calendar starts counting years from the Hijra, not from the Prophet’s birth. The Hijra began when persecution of Muslims in Makkah became severe and Allah commanded the Prophet to leave. The Prophet and Abu Bakr traveled together, hiding in the Cave of Thawr for three nights along the way. The Hijra marks the moment when the Muslims went from being a persecuted minority to a community building a new home in Madinah, where Islam grew rapidly.

Where in the Quran is the story of Abu Bakr in the cave?

The cave moment is referenced directly in the Quran in Surah At-Tawbah (chapter 9), verse 40. The verse describes the Prophet Muhammad ﷺ saying to his companion in the cave, "Do not be sad, Allah is with us" (la tahzan innallaha ma‘ana). Islamic scholars universally identify this companion as Abu Bakr. The Quran itself does not name him in this verse, but the identification comes from hadith and tafsir (Quranic commentary) that has been consistently preserved across the centuries. The fuller narrative of the cave, including the spider and the dove, comes from the seerah, the biographical accounts of the Prophet’s life recorded by scholars such as Ibn Ishaq and Ibn Hisham.

What is the source of this story?

The story of the cave is preserved in multiple authentic Islamic sources. The Quran references the moment directly in Surah At-Tawbah (9:40). The story is also recorded in Sahih al-Bukhari and Sahih Muslim, the two most trusted hadith collections in Sunni Islam. The full narrative, including the details of the spider's web and the dove's nest, comes from the classical seerah (prophetic biography) works, particularly Sirat Rasul Allah by Ibn Ishaq, later edited by Ibn Hisham. These accounts have been transmitted faithfully for more than 1,400 years.

Will this story scare my child?

The story has a tense moment when the Prophet ﷺ and Abu Bakr hear footsteps near the cave, but the resolution is reassuring rather than frightening. Allah sends a spider and a dove, two of the smallest creatures, to protect the two travelers without violence or harm. The takeaway, "Do not be sad, Allah is with us," is one of the most comforting phrases in Islam. Most children find this story exciting in the way a story about courage and protection is exciting, not frightening. If your child is especially sensitive, you can emphasize how calm the Prophet was and how Allah took care of everything quietly.

How can I use this story with my child?

This story is wonderful for children who feel scared or worried, especially about things they cannot control. After reading, you might ask: "How do you think Abu Bakr felt when he heard the footsteps?" or "Why was the Prophet so calm?" You can also teach your child the phrase "La tahzan innallaha ma‘ana" (Do not be sad, Allah is with us) as something they can say to themselves any time they feel afraid. The story also opens conversations about how Allah uses small things, even spiders and birds, to do big things, and that we are never alone when we trust in Allah.