Language:
كتاب الصلاة
8  
Prayers (Salat)
(81)
Chapter: The doors and locks of the Kabah and the mosques
(81)
باب الأَبْوَابِ وَالْغَلَقِ لِلْكَعْبَةِ وَالْمَسَاجِدِ
Sahih al-Bukhari 468

Narrated Nafi`:

Ibn `Umar said, "The Prophet (ﷺ) arrived at Mecca and sent for `Uthman bin Talha. He opened the gate of the Ka`ba and the Prophet, Bilal, Usama bin Zaid and `Uthman bin Talha entered the Ka`ba and then they closed its door (from inside). They stayed there for an hour, and then came out." Ibn `Umar added, "I quickly went to Bilal and asked him (whether the Prophet (ﷺ) had prayed). Bilal replied, 'He prayed in it.' I asked, 'Where?' He replied, 'Between the two pillars.' "Ibn `Umar added, "I forgot to ask how many rak`at he (the Prophet) had prayed in the Ka`ba."

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