Where the story is told and the background

Quran 9:40 reminds the believers that Allah had already helped His Prophet ﷺ when those who disbelieved drove him out, "as one of two, when they were in the cave", and he said to his companion not to grieve, for Allah was with them. In Quran 8:30 Allah recalls that the disbelievers plotted to restrain him, kill him or expel him, and says that they plan and Allah plans, and Allah is the best of planners. The Quran does not describe how the plot unfolded.

The details come from hadith. In the long narration of Aisha (may Allah be pleased with her) in Sahih al-Bukhari (3905), the Prophet ﷺ told the Muslims that he had been shown the land of their migration, a land of date palms between two lava fields, and many of them left for Madinah. Abu Bakr prepared to go as well, but the Prophet ﷺ told him to wait, as he hoped to be given permission. So Abu Bakr kept himself ready to accompany him, and fed two mounts for four months.

The decision to leave

One day at midday the Prophet ﷺ came to Abu Bakr's house, at an hour when he did not usually come. He asked for the others to leave and told Abu Bakr that he had been permitted to depart. Abu Bakr asked whether he would be his companion, and the Prophet ﷺ said yes.

Abu Bakr offered one of his two mounts, but the Prophet ﷺ said it must be by a price. The family prepared provisions in a bag, and Asma, the daughter of Abu Bakr (may Allah be pleased with her), cut a piece of her waistband to tie its mouth. For this she was called Dhat an-Nitaqayn, the one with the two waistbands.

In the cave

The Prophet ﷺ and Abu Bakr went to a cave in Mount Thawr and stayed there three nights. Each night Abdullah, the son of Abu Bakr, a clever young man, stayed with them, then left before dawn to be among the Quraysh in Makkah as if he had spent the night there. He remembered whatever was being plotted and brought the news at nightfall. Amir ibn Fuhayra, a freed servant of Abu Bakr (may Allah be pleased with them), grazed his flock nearby and brought them fresh milk in the evening.

Abu Bakr said, in a narration in Sahih al-Bukhari (3653), that he told the Prophet ﷺ in the cave that if one of the searchers looked down at his feet, he would see them. The Prophet ﷺ answered: "What do you think, Abu Bakr, of two whose third is Allah?"

This is the moment described in Quran 9:40, which says that Allah sent down His tranquillity upon him and supported him with forces that people did not see.

The road to Madinah

They had hired a man from Banu ad-Dil, a skilled guide who was still on the religion of the Quraysh but whom they trusted. They gave him their mounts, and he came to the cave after three nights. Then he and Amir ibn Fuhayra took them by the coastal road.

Suraqa ibn Malik later told what happened (Sahih al-Bukhari 3906). The Quraysh had set a reward, equal to a blood-price, for each of the two. Suraqa set out after them, but his horse stumbled, and later its front legs sank into the ground up to the knees. He noticed that the Prophet ﷺ did not turn around while reciting, while Abu Bakr looked back often. Suraqa called for safety, and he felt that the Prophet's mission would prevail. He told them what the people intended and offered supplies, and they asked only that he keep their journey hidden. At his request, Amir ibn Fuhayra wrote him a document of safety on a piece of leather.

On the way, az-Zubayr (may Allah be pleased with him), returning from Sham with Muslim traders, gave them white garments.

Quba and Madinah

The Muslims of Madinah had been going out every morning to the lava fields to wait for him, until the noon heat sent them home. One day a man from the Jews, on top of a fortress, saw the party in white and cried out that the man they were waiting for had come. The Muslims took up their weapons to meet him.

The Prophet ﷺ stayed with Banu Amr ibn Awf, at Quba, on a Monday in Rabi' al-Awwal. Abu Bakr stood to receive the people while the Prophet ﷺ sat quietly. When the sun reached the Prophet ﷺ, Abu Bakr shaded him with his cloak, and then the people recognised him. He stayed there for more than ten nights, and the mosque founded on piety, as the hadith calls it, was established.

Then he rode on, and his camel knelt at a date-drying yard owned by two orphan boys. He said it was, Allah willing, the place, and he bargained with them to take it for a mosque. They said they would give it as a gift. Then he built the mosque there, carrying bricks with the others.

What the sources do not tell, and what scholars said

The Quran does not name the companion in the cave, but the hadith identifies him as Abu Bakr. The authentic narration quoted here does not name the guide, only his tribe and skill, so this page does not add a name.

Reports about a spider's web at the mouth of the cave and a dove are found in later books of biography. They are not in the Quran or in Sahih al-Bukhari and Sahih Muslim, scholars differ on their strength and many consider them weak, so this page does not rely on them.

Some commentators connect Quran 28:85, "He who imposed the Quran upon you will take you back to a place of return", with the migration. Ibn Abbas explained the place of return as Makkah.

Lessons from this story

  • Allah's help comes to the heart that trusts Him. In the cave the Prophet ﷺ said, "Do not grieve; Allah is with us", and tranquillity came down on him (9:40).
  • Trust in Allah does not cancel preparation. The story shows careful planning: provisions, mounts, a guide, news from Makkah and milk from the flock, followed by firm reliance on Allah.
  • Many people shared in the hijra, each with a part: Abu Bakr, Aisha, Asma, Abdullah and Amir. Small acts of loyalty and sacrifice matter.
  • A true companion cares more for the other than for himself. Abu Bakr's fear was for the Prophet ﷺ, and he had kept his mounts ready for months.
  • Plots do not defeat Allah's plan. Quran 8:30 says that they plan and Allah plans, and Allah is the best of planners.

General information for learning, not a fatwa. For your own situation, ask a qualified scholar.

Sources