Sahih al-Bukhari 397
Narrated Mujahid:
Someone came to Ibn 'Umar and said, "Here is Allah's Apostle entering the Ka'ba." Ibn 'Umar said, "I went there but the Prophet had come out of the Ka'ba and I found Bilal standing between its two doors. I asked Bilal, 'Did the Prophet pray in the Ka'ba?' Bilal replied, 'Yes, he prayed two Rakat between the two pillars which are to your left on entering the Ka'ba. Then Allah's Apostle came out and offered a two-Rak'at prayer facing the Ka'ba.' "
حَدَّثَنَا مُسَدَّدٌ، قَالَ حَدَّثَنَا يَحْيَى، عَنْ سَيْفٍ، قَالَ سَمِعْتُ مُجَاهِدًا، قَالَ أُتِيَ ابْنُ عُمَرَ فَقِيلَ لَهُ هَذَا رَسُولُ اللَّهِ ﷺ دَخَلَ الْكَعْبَةَ. فَقَالَ ابْنُ عُمَرَ فَأَقْبَلْتُ وَالنَّبِيُّ ﷺ قَدْ خَرَجَ، وَأَجِدُ بِلاَلاً قَائِمًا بَيْنَ الْبَابَيْنِ، فَسَأَلْتُ بِلاَلاً فَقُلْتُ أَصَلَّى النَّبِيُّ ﷺ فِي الْكَعْبَةِ قَالَ نَعَمْ رَكْعَتَيْنِ بَيْنَ السَّارِيَتَيْنِ اللَّتَيْنِ عَلَى يَسَارِهِ إِذَا دَخَلْتَ، ثُمَّ خَرَجَ فَصَلَّى فِي وَجْهِ الْكَعْبَةِ رَكْعَتَيْنِ.