I said to the Prophet ﷺ while we were in the cave, "If any of them were to look beneath his feet, he would see us."He replied, "Abu Bakr, what do you think of two whose third is Allah?"
قلت للنبي ﷺ وأنا في الغار: لو أن أحدهم نظر تحت قدميه لأبصرنا، فقال: ما ظنك يا أبا بكر باثنين الله ثالثهما.
Bukhari narrated it in the Virtues of the Companions (3653), and Muslim in the Virtues of the Companions (2381), both by way of Hammam, who said, Thabit narrated to us, who said, Anas bin Malik narrated to us, that Abu Bakr Siddiq told him, and he related it. This is the wording of Bukhari. Muslim added at the beginning, "I looked at the feet of the polytheists above our heads while we were in the cave, and I said, 'O Messenger of Allah, if one of them...'" and he related it.It is also narrated from Ibn Umar that the Messenger of Allah ﷺ said to Abu Bakr, "You are my companion at the Pool, and my companion in the cave." Tirmidhi narrated it (3670) from Yusuf bin Musa Qattan Baghdadi, who said, Malik bin Ismail narrated to us, from Mansur bin Abu Aswad, who said, Kathir Abu Ismail narrated to me, from Jami bin Umayr Taymi, from Ibn Umar, and he related it.Kathir is Ibn Ismail, or Ibn Nafi Nawwa, Abu Ismail Tamimi, who is daif according to the people of knowledge, and his teacher Jami bin Umayr is also daif according to the majority of the people of knowledge.The people of knowledge differed regarding the length of time the two of them stayed in the cave. Mujahid said three days. It is also narrated in a mursal hadith that the Prophet ﷺ said, "I stayed with my companion in the cave for some ten-odd days, with no food but the fruit of the barir," meaning the arak tree. Ibn Abdul-Barr said, This is not sahih according to the people of knowledge of hadith, and most hold to what Mujahid said. Al-Istiab (1490).