Sahih al-Bukhari 4663
Sahih al-Bukhari · Book 65: Prophetic Commentary on the Qur'an (Tafseer of the Prophet (pbuh)) · The Statement of Allah: “...The second of two, when they (Muhammad ﷺ and Abü Bakr were in the cave, and he ﷺ said to his companion (Abu Bakr ) ‘Be not sad (or afraid), surely Allah is with us.'" (V.9:40)
Narrated Abu Bakr:
حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مُحَمَّدٍ ، حَدَّثَنَا حَبَّانُ ، حَدَّثَنَا هَمَّامٌ ، حَدَّثَنَا ثَابِتٌ ، حَدَّثَنَا أَنَسٌ ، قَالَ حَدَّثَنِي أَبُو بَكْرٍ ـ رضى الله عنه ـ قَالَ كُنْتُ مَعَ النَّبِيِّ صلى الله عليه وسلم فِي الْغَارِ، فَرَأَيْتُ آثَارَ الْمُشْرِكِينَ قُلْتُ يَا رَسُولَ اللَّهِ، لَوْ أَنَّ أَحَدَهُمْ رَفَعَ قَدَمَهُ رَآنَا. قَالَ " مَا ظَنُّكَ بِاثْنَيْنِ اللَّهُ ثَالِثُهُمَا " .
I was in the company of the Prophet (ﷺ) in the cave, and on seeing the traces of the pagans, I said, "O Allah's Messenger (ﷺ) If one of them (pagans) should lift up his foot, he will see us." He said, "What do you think of two, the third of whom is Allah?"