It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that "the Messenger of Allah (peace and blessings be upon him) and his Companions (may Allah be pleased with them) prayed facing Bayt al-Maqdis for sixteen months, and after that the qiblah was changed." I say: Imam al-Hakim narrated it through the route of Abu Awanah, from Sulayman, from Mujahid, from Sayyiduna Ibn Abbas (may Allah be pleased with them both), that "the Prophet (peace and blessings be upon him) used to pray (in Makkah) facing Bayt al-Maqdis while the Ka'bah (the honoured) was in front of him, and after emigrating to Madinah he also (prayed in the same way) for sixteen months; then Allah Almighty turned him towards the Ka'bah." Imam al-Bayhaqi also narrated it in his Sunan with the chain of Imam al-Hakim, and Imam Ibn Majah narrated it with a sahih (authentic) chain from Sayyiduna al-Bara' bin Azib (may Allah be pleased with him).
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب القبلة وفيه ستر العورة وما يصلى فيه / 1111
Hadith Gradingمحدثین:إسناده صحيح
Hadith Takhrij«ورواه ابن ماجه بسند صحيح عن البراء بن عازب» «أخرجه مسند أحمد برقم: 2252، 2984، وأخرجه مجمع الزوائد ومنبع الفوائد برقم: 1967، وأخرجه الأحاديث المختارة برقم: 91، 134، وأخرجه فتح الباري برقم: 390، وأخرجه المعجم الكبير للطبراني برقم: 11066، وأخرجه البحر الزخار المعروف بمسند البزار 10 - 18 برقم: 4825، 4935»