Sayyiduna Bara’ bin Azib (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) prayed facing Bayt al-Maqdis for sixteen or seventeen years, and the Messenger of Allah (peace and blessings be upon him) wished in his heart to pray facing the Ka‘bah. Finally, Allah the Exalted revealed this verse: “We have certainly seen the turning of your face toward the heaven” (al-Baqarah 144). Then he turned his face toward the Ka‘bah, and the foolish ones among the Jews began to say, “What has turned them away from their former qiblah?” Say: “To Allah belongs the east and the west; He guides whom He wills.” (When the qiblah was changed,) a man had prayed with the Prophet (peace and blessings be upon him), and after the prayer he passed by a group of the Ansar who were praying the ‘Asr prayer facing Bayt al-Maqdis. He said, “I bear witness that I have prayed with the Messenger of Allah (peace and blessings be upon him) and he prayed facing the present qiblah (the Ka‘bah).” Then that group (while still in prayer) turned around and faced the Ka‘bah.
Hadith Referenceاللؤلؤ والمرجان / كتاب المساجد ومواضع الصلاة / 302
Hadith Gradingمحدثین:«صحیح»
Hadith Takhrij«صحیح، أخرجه البخاري في: 8 كتاب الصلاة: 31 باب التوجه نحو القبلة حيث كان»