Sahih Muslim 6175
The Book of the Merits of the Companions
حَدَّثَنَا عُثْمَانُ بْنُ أَبِي شَيْبَةَ، وَزُهَيْرُ بْنُ حَرْبٍ، وَإِسْحَاقُ بْنُ إِبْرَاهِيمَ، قَالَ إِسْحَاقُ أَخْبَرَنَا وَقَالَ الآخَرَانِ، حَدَّثَنَا جَرِيرٌ، عَنْ مُغِيرَةَ، عَنْ وَاصِلِ بْنِ حَيَّانَ، عَنْ عَبْدِ اللَّهِ بْنِ أَبِي، الْهُذَيْلِ عَنْ أَبِي الأَحْوَصِ، عَنْ عَبْدِ اللَّهِ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ " لَوْ كُنْتُ مُتَّخِذًا مِنْ أَهْلِ الأَرْضِ خَلِيلاً لاَتَّخَذْتُ ابْنَ أَبِي قُحَافَةَ خَلِيلاً وَلَكِنْ صَاحِبُكُمْ خَلِيلُ اللَّهِ " .
Abdullah reported Allah's Messenger (ﷺ) as saying:If I were to choose amongst the people of earth someone as my bosom friend, I would have chosen the son of Abu Quhafa as my friends but God has taken your companion as a friend
Text from the public-domain hadith-api dataset. Numbering follows that dataset and can differ by a few from some printed editions — check the wording, not only the number.