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?"
USC-MSA web (English) reference: Vol. 6, Book 60, Hadith 185
Arabic reference: Book 65, Hadith 4663