English translation
1010. It was narrated that Barâ' said: "We prayed with the Messenger of Allâh ﷺ 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 Allāh ﷺ prayed towards Baitul-Maqdis, he would often lift his face towards the heavens, and Allāh 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 Allāh ﷺ started watching him as he was descending between the heavens and the earth, waiting to see what he would bring. Then Allāh 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-Harām (at Makkah). And wherever you people are, turn your faces (during prayer) in that direction.'[1] 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 Allāh ﷺ said: 'O Jibril! What about our prayer facing towards Baitul-Maqdis?' Then Allāh revealed the words: "And Allāh would never make your faith to be lost."[2] (Da'if)
Arabic text
1010 - حَدَّثَنَا عَلْقَمَةُ بْنُ عَمْرٍو الدَّارِمِيُّ قَالَ: حَدَّثَنَا أَبُو بَكْرِ بْنُ عَيَّاشٍ، عَنْ أَبِي إِسْحَاقَ، عَنِ الْبَرَاءِ، قَالَ: صَلَّيْنَا مَعَ رَسُولِ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ نَحْوَ بَيْتِ الْمَقْدِسِ ثَمَانِيَةَ عَشَرَ شَهْرًا، وَصُرِفَتِ الْقِبْلَةُ إِلَى الْكَعْبَةِ بَعْدَ دُخُولِهِ إِلَى الْمَدِينَةِ بِشَهْرَيْنِ، وَكَانَ رَسُولُ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ، إِذَا صَلَّى إِلَى بَيْتِ الْمَقْدِسِ أَكْثَرَ تَقَلُّبَ وَجْهِهِ فِي السَّمَاءِ، وَعَلِمَ اللَّهُ مِنْ قَلْبِ نَبِيِّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ أَنَّهُ يَهْوَى الْكَعْبَةَ، فَصَعِدَ جِبْرِيلُ، فَجَعَلَ رَسُولُ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ يُتْبِعُهُ بَصَرَهُ وَهُوَ يَصْعَدُ بَيْنَ السَّمَاءِ وَالْأَرْضِ، يَنْظُرُ مَا يَأْتِيهِ بِهِ، فَأَنْزَلَ اللَّهُ: {قَدْ نَرَى تَقَلُّبَ وَجْهِكَ فِي السَّمَاءِ} [البقرة: 144] الْآيَةَ، فَأَتَانَا آتٍ، فَقَالَ: إِنَّ الْقِبْلَةَ قَدْ صُرِفَتْ إِلَى الْكَعْبَةِ، وَقَدْ صَلَّيْنَا رَكْعَتَيْنِ إِلَى بَيْتِ الْمَقْدِسٍ وَنَحْنُ رُكُوعٌ فَتَحَوَّلْنَا، فَبَنَيْنَا عَلَى مَا مَضَى مِنْ صَلَاتِنَا، فَقَالَ رَسُولُ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ: «يَا جِبْرِيلُ كَيْفَ حَالُنَا فِي صَلَاتِنَا إِلَى بَيْتِ الْمَقْدِسِ؟» فَأَنْزَلَ اللَّهُ عَزَّ وَجَلَّ: {وَمَا كَانَ اللَّهُ لِيُضِيعَ إِيمَانَكُمْ} [البقرة: 143]