Sahih Muslim Book 7, Hadith Number 3068.

Chapter : The merit of entering the ka’ba for a pilgrim and observing of prayer in it.

Ibn Umar (Allah be pleased with them) reported that Allah’s Messenger (may peace, be upon him) entered the Ka’ba. Usama, Bilal and ‘Uthman b. Talha, the keeper (of the Ka’ba), were along with him. He closed the door and stayed in it for some time. Ibn ‘Umar (Allah be pleased with them) said: I asked Bilal as he came out what Allah’s Messenger (may peace be upon him) had done there. He said: He prayed there in (such a position) that two pillars were on his left side, one pillar on his right, and three pillars were behind him, and the House at that time was resting on six pillars.