Sahih al-Bukhari, Book 8, Hadith 49 (Bukhari 393)

Narrated Ibn `Abbas:

When the Prophet (ﷺ) entered the Ka`ba, he invoked Allah in each and every side of it and did not pray till he came out of it, and offered a two-rak`at prayer facing the Ka`ba and said, "This is the Qibla."