Jaʿfar ibn Sulaymān narrated to us; Abū ʿImrān al-Jawnī narrated to us; al-Muʿallā ibn Ziyād narrated from al-Ḥasan al-Baṣrī, who said:
The Prophet ﷺ and Abū Bakr set off for the cave and entered it. A spider then came and spun its web across the mouth of the cave. Quraysh arrived in pursuit of the Prophet ﷺ, but whenever they saw the spider’s weaving over the entrance they would say, “No one has gone inside.” The Prophet ﷺ stood in prayer while Abū Bakr kept watch. Abū Bakr said to the Prophet ﷺ, “May my father and mother be ransomed for you! These are your own people looking for you. By Allah, I do not weep for myself; I weep only lest I witness something befall you that I would hate to see.” The Prophet ﷺ replied, “O Abū Bakr, do not fear; indeed Allah is with us.”
This report is mursal from al-Ḥasan, yet in its category as corroborative evidence it is ḥasan, and it adds the detail that the Prophet ﷺ prayed inside the cave. Whenever something distressed him, he would pray.
This same author—namely Abū Bakr Aḥmad ibn ʿAlī al-Qāḍī—also related, through ʿAmr al-Nāqid, through Khalaf ibn Tamīm, through Mūsā ibn Muṭayr, from his father, from Abū Hurayrah, that Abū Bakr said to his son: “My son, if turmoil ever strikes the people, then go to the cave in which the Messenger of Allah ﷺ and I took refuge and remain there, for your provision will come to you in it morning and evening.”
One of the poets put this episode into verse, saying (khafīf metre):
The craft of David sheltered not the man of the cave—
all the glory belonged to the spider.
It is also reported that two doves nested at the entrance, which al-Ṣarṣarī versified:
The spider concealed him with its weaving,
while the doves remained on the threshold, laying their eggs.
Al-Ḥāfiẓ Ibn ʿAsākir transmitted this tradition through Yaḥyā ibn Muḥammad ibn Ṣāʿid: ʿAmr ibn ʿAlī narrated to us; ʿAwn ibn ʿAmr Abū ʿAmr al-Qaysī—nicknamed ʿUwayn—narrated to us; Abū Muṣʿab al-Makkī narrated to me. He said, “I met Zayd ibn Arqam, al-Mughīrah ibn Shuʿbah, and Anas ibn Mālik, who recounted that on the night of the cave the Prophet ﷺ commanded a tree, and it came forth …”