(14) CHAPTER. The Statement of Allah: “...And We made the Qiblah (prayer direction towards Jerusalem) which you used to face, only to test those who followed the Messenger (Muhammad )...” (V.2:143)
Narrated Ibn `Umar: While some people were offering Fajr prayer in the Quba' mosque, some-one came and said, Allah has revealed to the Prophet Qur'anic instructions that you should face the Ka`ba (while praying) so you too, should face it. Those people then turned towards the Ka`ba.
Narrated Anas: None remains of those who prayed facing both Qiblas (that is, Jerusalem and Mecca) except myself.