Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ibnmajah:1010ʿAlqamah b. ʿAmr al-Dārimī > Abū Bakr b. ʿAyyāsh > Abū Isḥāq > al-Barāʾ

“We prayed with the Messenger of Allah ﷺ facing towards Baitul-Maqdis (Jerusalem) for eighteen months, then the Qiblah was changed to the Ka’bah two months after the Prophet ﷺ entered Al-Madinah. When the Messenger of Allah ﷺ prayed towards Baitul-Maqdis, he would often lift his face towards the heavens, and Allah knew what was in the heart of His Prophet and how he longed to face the Ka’bah (during prayer). Jibril appeared (in the sky), and the Messenger of Allah ﷺ started watching him as he was descending between the heavens and the earth, waiting to see what he would bring. Then Allah revealed the words: ‘Verily, We have seen the turning of your face towards the heaven. Surely, We shall turn you to a Qiblah that shall please you, so turn your face in the direction of Al-Masjid Al-Haram (at Makkah). And wherever you people are, turn your faces (during prayer) in that direction.’ [2:144] Then someone came to us and said: ‘The Qiblah has been changed to the Ka’bah.’ We had performed two Rak’ah facing towards Jerusalem. And we were bowing. So we turned around, and we continued our prayer. The Messenger of Allah ﷺ said: ‘O Jibril! What about our prayer facing towards Baitul- Maqdis?’ Then Allah revealed the words: “And Allah would never make your faith to be lost.” [2:143]  

ابن ماجة:١٠١٠حَدَّثَنَا عَلْقَمَةُ بْنُ عَمْرٍو الدَّارِمِيُّ حَدَّثَنَا أَبُو بَكْرِ بْنُ عَيَّاشٍ عَنْ أَبِي إِسْحَاقَ عَنِ الْبَرَاءِ قَالَ

صَلَّيْنَا مَعَ رَسُولِ اللَّهِ ﷺ نَحْوَ بَيْتِ الْمَقْدِسِ ثَمَانِيَةَ عَشَرَ شَهْرًا وَصُرِفَتِ الْقِبْلَةُ إِلَى الْكَعْبَةِ بَعْدَ دُخُولِهِ إِلَى الْمَدِينَةِ بِشَهْرَيْنِ وَكَانَ رَسُولُ اللَّهِ ﷺ إِذَا صَلَّى إِلَى بَيْتِ الْمَقْدِسِ أَكْثَرَ تَقَلُّبَ وَجْهِهِ فِي السَّمَاءِ وَعَلِمَ اللَّهُ مِنْ قَلْبِ نَبِيِّهِ ﷺ أَنَّهُ يَهْوَى الْكَعْبَةَ فَصَعِدَ جِبْرِيلُ فَجَعَلَ رَسُولُ اللَّهِ ﷺ يُتْبِعُهُ بَصَرَهُ وَهُوَ يَصْعَدُ بَيْنَ السَّمَاءِ وَالأَرْضِ يَنْظُرُ مَا يَأْتِيهِ بِهِ فَأَنْزَلَ اللَّهُ {قَدْ نَرَى تَقَلُّبَ وَجْهِكَ فِي السَّمَاءِ} الآيَةَ فَأَتَانَا آتٍ فَقَالَ إِنَّ الْقِبْلَةَ قَدْ صُرِفَتْ إِلَى الْكَعْبَةِ وَقَدْ صَلَّيْنَا رَكْعَتَيْنِ إِلَى بَيْتِ الْمَقْدِسِ وَنَحْنُ رُكُوعٌ فَتَحَوَّلْنَا فَبَنَيْنَا عَلَى مَا مَضَى مِنْ صَلاَتِنَا فَقَالَ رَسُولُ اللَّهِ ﷺ يَا جِبْرِيلُ كَيْفَ حَالُنَا فِي صَلاَتِنَا إِلَى بَيْتِ الْمَقْدِسِ فَأَنْزَلَ اللَّهُ ﷻ {وَمَا كَانَ اللَّهُ لِيُضِيعَ إِيمَانَكُمْ}