عَنْ عَبْدِ اللَّهِ بْنِ دِينَارٍ عَنِ ابْنِ عُمَرَ رَضِيَ اللَّهُ عَنْهُمَا قَالَ: بَيْنَمَا النَّاسُ بِقُبَاءٍ فِي صَلَاةِ الصُّبْحِ إِذْ أَتَاهُمْ آتٍ فَقَالَ: إِنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ أُنْزِلَ عَلَيْهِ قُرْآنٌ اللَّيْلَةَ، وَقَدْ أُمِرَ أَنْ يَسْتَقْبِلَ الْكَعْبَةَ فَاسْتَقْبِلُوهَا وَكَانَتْ وُجُوهُهُمْ إِلَى الشَّامِ فَاسْتَدَارُوا إِلَى الْكَعْبَةِ
Sayyiduna Ibn Umar (may Allah be pleased with him) says that some people in Quba were performing the Fajr prayer when a person came to them and said: Last night, Qur’an was revealed to the Messenger of Allah (peace and blessings be upon him), according to which he has been commanded to face the Ka’bah, so you too should turn towards it. Their faces were towards Shaam (i.e., Bayt al-Maqdis), but upon hearing this announcement, they turned towards the Ka’bah.