`Sayyiduna Ibn Abbas (may Allah be pleased with them) says` When the Prophet Muhammad (peace be upon him) entered the Ka'bah, he supplicated in all its corners and did not pray until he came out of the Ka'bah. Then, when he came out, he prayed two rak'ahs facing the Ka'bah and said that this is the Qiblah.