كتاب الحج
15  
The Book of Pilgrimage
(68)
Chapter: It is recommended for pilgrims and others to enter the Ka'bah and pray therein, and supplicate in all its corners
(68)
باب اسْتِحْبَابِ دُخُولِ الْكَعْبَةِ لِلْحَاجِّ وَغَيْرِهِ وَالصَّلاَةِ فِيهَا وَالدُّعَاءِ فِي نَوَاحِيهَا كُلِّهَا
Sahih Muslim 1329 b

Ibn Umar (Allah be pleased with them) reported:

Allah's Messenger (ﷺ) came on the Day of Victory, and got down in the courtyard of the Ka'ba and he sent (a message) for 'Uthman b. Talha (Allah be pleased with them). He came with the key and opened the door. Allah's Apostle (ﷺ) then entered therein and Bilal, Usama b. Zaid, and 'Uthman b. Talha (along with him), and then commanded the door to be closed. They stayed there for a considerable time, and then the door was opened, and Abdullah said: I was the first to meet Allah's Messenger. (ﷺ). outside (the Ka'ba), and Bilal was close behind him. I said to Bilal: Did Allah's Messenger (ﷺ) observe prayer therein? He said: Yes. I said: Where? He said: Between the two pillars in front of his face. He said: I forgot to ask him as to the number of rakahs he prayed.
حَدَّثَنَا أَبُو الرَّبِيعِ الزَّهْرَانِيُّ، وَقُتَيْبَةُ بْنُ سَعِيدٍ، وَأَبُو كَامِلٍ الْجَحْدَرِيُّ كُلُّهُمْ عَنْ حَمَّادِ بْنِ زَيْدٍ، - قَالَ أَبُو كَامِلٍ - حَدَّثَنَا حَمَّادٌ، حَدَّثَنَا أَيُّوبُ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَ قَدِمَ رَسُولُ اللَّهِ صلى الله عليه وسلم يَوْمَ الْفَتْحِ فَنَزَلَ بِفِنَاءِ الْكَعْبَةِ وَأَرْسَلَ إِلَى عُثْمَانَ بْنِ طَلْحَةَ فَجَاءَ بِالْمِفْتَحِ فَفَتَحَ الْبَابَ - قَالَ - ثُمَّ دَخَلَ النَّبِيُّ صلى الله عليه وسلم وَبِلاَلٌ وَأُسَامَةُ بْنُ زَيْدٍ وَعُثْمَانُ بْنُ طَلْحَةَ وَأَمَرَ بِالْبَابِ فَأُغْلِقَ فَلَبِثُوا فِيهِ مَلِيًّا ثُمَّ فَتَحَ الْبَابَ ‏.‏ فَقَالَ عَبْدُ اللَّهِ فَبَادَرْتُ النَّاسَ فَتَلَقَّيْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم خَارِجًا وَبِلاَلٌ عَلَى إِثْرِهِ فَقُلْتُ لِبِلاَلٍ هَلْ صَلَّى فِيهِ رَسُولُ اللَّهِ صلى الله عليه وسلم قَالَ نَعَمْ ‏.‏ قُلْتُ أَيْنَ قَالَ بَيْنَ الْعَمُودَيْنِ تِلْقَاءَ وَجْهِهِ ‏.‏ قَالَ وَنَسِيتُ أَنْ أَسْأَلَهُ كَمْ صَلَّى.
Reference : Sahih Muslim 1329b
In-book reference : Book 15, Hadith 435
USC-MSA web (English) reference : Book 7, Hadith 3069
  (deprecated numbering scheme)