Imam Bukhari narrates: Musaddad narrated to us, he said: Yahya narrated to us from Saif, he said: I heard Mujahid saying that
Hazrat Ibn Umar, Allah be pleased with them both, came, and it was said to him: This is the Messenger of Allah ﷺ, who has entered the Ka'bah. Hazrat Ibn Umar said: I came and the Prophet ﷺ had come out of the Ka'bah, I saw Hazrat Bilal, Allah be pleased with him, standing between the two doors. I asked Hazrat Bilal and said: Has the Prophet ﷺ prayed inside the Ka'bah? He said: When he entered the Ka'bah, between the two pillars which are on his left side, he prayed two rak'ahs there, then he came out and prayed two rak'ahs in front of the Ka'bah.
حَدَّثَنَا مُسَدَّدٌ، قَالَ حَدَّثَنَا يَحْيَى، عَنْ سَيْفٍ، قَالَ سَمِعْتُ مُجَاهِدًا، قَالَ أُتِيَ ابْنُ عُمَرَ فَقِيلَ لَهُ هَذَا رَسُولُ اللَّهِ صلى الله عليه وسلم دَخَلَ الْكَعْبَةَ. فَقَالَ ابْنُ عُمَرَ فَأَقْبَلْتُ وَالنَّبِيُّ صلى الله عليه وسلم قَدْ خَرَجَ، وَأَجِدُ بِلاَلاً قَائِمًا بَيْنَ الْبَابَيْنِ، فَسَأَلْتُ بِلاَلاً فَقُلْتُ أَصَلَّى النَّبِيُّ صلى الله عليه وسلم فِي الْكَعْبَةِ قَالَ نَعَمْ رَكْعَتَيْنِ بَيْنَ السَّارِيَتَيْنِ اللَّتَيْنِ عَلَى يَسَارِهِ إِذَا دَخَلْتَ، ثُمَّ خَرَجَ فَصَلَّى فِي وَجْهِ الْكَعْبَةِ رَكْعَتَيْنِ.
Reference: Sahih Al Bukhari 397