Sayyiduna Ibn Abbas (may Allah be pleased with them both) said: The Messenger of Allah (peace and blessings be upon him) entered the Ka'bah and prayed two rak'ahs between the two pillars. Then he came out and prayed two rak'ahs between the door of the House and the Hijr (Hatim), and then said: "This is the qiblah." Then on another occasion he entered the Ka'bah, stood up to supplicate, and did not pray.
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 12295