It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that the people were offering the Fajr prayer in Quba when a companion came to them and said that the Qur'an has been revealed to the Messenger of Allah (peace and blessings be upon him), and he has been commanded to turn his face towards the Ka'bah. So those people also turned towards the Ka'bah, and their faces were towards Shaam (Syria), then they turned around and faced the Ka'bah.
Hadith Referenceسنن دارمي / من كتاب الصللاة / 1268
Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) said: It was asked: O Messenger of Allah, what is your opinion about those people who passed away while praying facing towards Bayt al-Maqdis? So Allah Almighty revealed this noble verse: "Allah will not let your faith go to waste." [بقرة: 143/2]
Hadith Referenceسنن دارمي / من كتاب الصللاة / 1269
Hadith Gradingتحقیق (حسین سلیم أسد الدارانی):إسناده ضعيف رواية سماك عن عكرمة مضطربة، [مكتبه الشامله نمبر: 1271]
Hadith Takhrijاس روایت کی سند میں ضعف ہے، لیکن دوسری سند سے یہ صحیح حدیث متفق علیہ ہے۔ دیکھئے: [بخاري 40] ، [مسلم 525] ، [ابن حبان 1717] ، [الموارد 1718]