The Prophet ﷺ said, "Had I taken anyone as a close friend, I would have taken Abu Bakr as such. But he is my brother and my companion, and Allah has taken your companion as His close friend."
عن النبي ﷺ قال: لو كنت متخذا خليلا لاتخذت أبا بكر خليلا ولكنه أخي وصاحبي، وقد اتخذ الله صاحبكم خليلا.
Muslim reported it in the Merits of the Companions (2383-3), from Muhammad bin Bashshar Abdi, who said, Muhammad bin Jafar told us, Shubah told us, from Ismail bin Raja, I heard Abdullah bin Abu Huzayl, from Abu Ahwas, I heard Abdullah bin Masud mention it.In another wording, "If I were to take anyone from my nation as an intimate friend..." Muslim reported it (2383-4) through another route, from Abu Ishaq, from Abu Ahwas, with the same account.In another wording, "If I were to take anyone from the people of the earth as an intimate friend, I would have taken the son of Abu Quhafa as an intimate friend, but your companion is the intimate friend of Allah." Muslim reported it (2383-6) through another route, from Wasil bin Hayan, from Abdullah bin Abu Huzayl, from Abu Ahwas, with the same account.In yet another wording, "Indeed I disavow before every close friend his friendship, and if I were to take an intimate friend, I would have taken Abu Bakr as an intimate friend, for indeed your companion is the intimate friend of Allah." Muslim reported it (2383-7) through another route, from Abdullah bin Mura, from Abu Ahwas, with the same account.