Language:
كتاب الصلاة
8  
Prayers (Salat)
(80)
Chapter: Al-Khaukhah (a small door) and a path in the mosque
(80)
باب الْخَوْخَةِ وَالْمَمَرِّ فِي الْمَسْجِدِ
Sahih al-Bukhari 466

Narrated Abu Sa`id Al-Khudri:

The Prophet (ﷺ) delivered a sermon and said, "Allah gave a choice to one of (His) slaves either to choose this world or what is with Him in the Hereafter. He chose the latter." Abu Bakr wept. I said to myself, "Why is this Sheikh weeping, if Allah gave choice to one (of His) slaves either to choose this world or what is with Him in the Here after and he chose the latter?" And that slave was Allah's Messenger (ﷺ) himself. Abu Bakr knew more than us. The Prophet (ﷺ) said, "O Abu Bakr! Don't weep. The Prophet (ﷺ) added: Abu- Bakr has favored me much with his property and company. If I were to take a Khalil from mankind I would certainly have taken Abu Bakr but the Islamic brotherhood and friendship is sufficient. Close all the gates in the mosque except that of Abu Bakr.

حَدَّثَنَا مُحَمَّدُ بْنُ سِنَانٍ، قَالَ حَدَّثَنَا فُلَيْحٌ، قَالَ حَدَّثَنَا أَبُو النَّضْرِ، عَنْ عُبَيْدِ بْنِ حُنَيْنٍ، عَنْ بُسْرِ بْنِ سَعِيدٍ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ، قَالَ خَطَبَ النَّبِيُّ صلى الله عليه وسلم فَقَالَ ‏"‏ إِنَّ اللَّهَ خَيَّرَ عَبْدًا بَيْنَ الدُّنْيَا وَبَيْنَ مَا عِنْدَهُ، فَاخْتَارَ مَا عِنْدَ اللَّهِ ‏"‏‏.‏ فَبَكَى أَبُو بَكْرٍ ـ رضى الله عنه ـ فَقُلْتُ فِي نَفْسِي مَا يُبْكِي هَذَا الشَّيْخَ إِنْ يَكُنِ اللَّهُ خَيَّرَ عَبْدًا بَيْنَ الدُّنْيَا وَبَيْنَ مَا عِنْدَهُ فَاخْتَارَ مَا عِنْدَ اللَّهِ، فَكَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم هُوَ الْعَبْدَ، وَكَانَ أَبُو بَكْرٍ أَعْلَمَنَا‏.‏ قَالَ ‏"‏ يَا أَبَا بَكْرٍ لاَ تَبْكِ، إِنَّ أَمَنَّ النَّاسِ عَلَىَّ فِي صُحْبَتِهِ وَمَالِهِ أَبُو بَكْرٍ، وَلَوْ كُنْتُ مُتَّخِذًا خَلِيلاً مِنْ أُمَّتِي لاَتَّخَذْتُ أَبَا بَكْرٍ، وَلَكِنْ أُخُوَّةُ الإِسْلاَمِ وَمَوَدَّتُهُ، لاَ يَبْقَيَنَّ فِي الْمَسْجِدِ باب إِلاَّ سُدَّ إِلاَّ باب أَبِي بَكْرٍ ‏"‏‏.‏
Reference : Sahih al-Bukhari 466
In-book reference : Book 8, Hadith 114
USC-MSA web (English) reference : Vol. 1, Book 8, Hadith 455
  (deprecated numbering scheme)