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.
hakim:3060Ibn Jurayj > ʿAṭāʾ > Ibn ʿAbbās > Awwal Mā Nusikh from al-Qurān Fīmā Dhukir Lanā Shaʾn al-Qiblah

[Machine] The first thing that was abrogated from the Quran regarding the mention of the matter of the Qibla, Allah said, "{To Allah belongs the east and the west. So wherever you [might] turn, there is the face of Allah.}" (Al-Baqarah 2:115). So the Messenger of Allah ﷺ turned towards the direction of Bait al-Maqdis (Jerusalem) and left the Ancient House (Kaaba), and then Allah, the Exalted, said, "{The foolish among the people will say, 'What has turned them away from their qiblah, which they used to face?'}" (Al-Baqarah 2:142). They meant Bait al-Maqdis, so Allah abrogated it and directed it to the Ancient House, and Allah, the Exalted, said, "{And from wherever you go out [for prayer], turn your face toward al-Masjid al-Haram. And wherever you [believers] may be, turn your faces toward it}" (Al-Baqarah 2:150).  

الحاكم:٣٠٦٠عَنِ ابْنِ جُرَيْجٍ عَنْ عَطَاءٍ عَنِ ابْنِ عَبَّاسٍ قَالَ

أَوَّلُ مَا نُسِخَ مِنَ الْقُرْآنِ فِيمَا ذُكِرَ لَنَا شَأْنُ الْقِبْلَةِ قَالَ اللَّهُ {وَلِلَّهِ الْمَشْرِقُ وَالْمَغْرِبُ فَأَيْنَمَا تُوَلُّوا فَثَمَّ وَجْهُ اللَّهِ} [البقرة 115] فَاسْتَقْبَلَ رَسُولُ اللَّهِ ﷺ فَصَلَّى نَحْوَ بَيْتِ الْمَقْدِسِ وَتَرَكَ الْبَيْتَ الْعَتِيقَ فَقَالَ اللَّهُ تَعَالَى {سَيَقُولُ السُّفَهَاءُ مِنَ النَّاسِ مَا وَلَّاهُمْ عَنْ قِبْلَتِهِمُ الَّتِي كَانُوا عَلَيْهَا} [البقرة 142] يَعْنُونَ بَيْتَ الْمَقْدِسِ فَنَسَخَتْهَا وَصَرَفَهُ اللَّهُ إِلَى الْبَيْتِ الْعَتِيقِ فَقَالَ اللَّهُ تَعَالَى {وَمِنْ حَيْثُ خَرَجْتَ فَوَلِّ وَجْهَكَ شَطْرَ الْمَسْجِدِ الْحَرَامِ وَحَيْثُ مَا كُنْتُمْ فَوَلُّوا وُجُوهَكُمْ شَطْرَهُ} [البقرة 150]  

«هَذَا حَدِيثٌ صَحِيحٌ عَلَى شَرْطِ الشَّيْخَيْنِ وَلَمْ يُخَرِّجَاهُ بِهَذِهِ السِّيَاقَةِ» على شرط البخاري ومسلم

See similar narrations below:

Collected by Bayhaqī
bayhaqi:2245Abū ʿAbdullāh al-Ḥāfiẓ > Abū Bakr Ismāʿīl b. Muḥammad al-Faqīh Bi-al-Rrī > Muḥammad b. al-Faraj al-Azraq > Ḥajjāj b. Muḥammad > Ibn Jurayj > ʿAṭāʾ > Ibn ʿAbbās > Awwal

[Machine] The first thing that was abrogated from the Qur'an, as mentioned to us and Allah knows best, is the matter of the Qiblah. Allah, may He be glorified and exalted, said, "To Allah belong the east and the west. So wherever you [might] turn, there is the Face of Allah." (Quran 2:115) So the Messenger of Allah ﷺ faced towards the direction of the Bayt al-Maqdis (Jerusalem) and left the Ancient House (the Kaaba). Allah then abrogated it and turned him towards the Ancient House (the Kaaba) and said, "From wherever you go out [for prayer], turn your face toward al-Masjid al-Haram. And wherever you [believers] may be, turn your faces toward it." (Quran 2:144) According to the statements of Imam ash-Shafi'i (may Allah have mercy on him), this narration is attributed to Ibn Abbas (may Allah be pleased with him), who entered into a detailed explanation: when he migrated to Madinah, he faced Bayt al-Maqdis out of devotion to the Ancient House (the Kaaba), and he would have loved it if Allah had made facing the Ancient House (the Kaaba) obligatory for him. So Allah revealed this verse to him before He revealed the verse "We have certainly seen the turning of your face toward the heaven." (Quran 2:144) Sheikh also mentioned that it is narrated from Ibn Abbas (may Allah be pleased with him) that it was revealed with regard to their statement, "They have turned away from their qiblah." (Quran 2:142)  

البيهقي:٢٢٤٥أَخْبَرَنَا أَبُو عَبْدِ اللهِ الْحَافِظُ أَخْبَرَنِي أَبُو بَكْرٍ إِسْمَاعِيلُ بْنُ مُحَمَّدٍ الْفَقِيهُ بِالرِّيِّ ثنا مُحَمَّدُ بْنُ الْفَرَجِ الْأَزْرَقُ ثنا حَجَّاجُ بْنُ مُحَمَّدٍ عَنِ ابْنِ جُرَيْجٍ عَنْ عَطَاءٍ عَنِ ابْنِ عَبَّاسٍ قَالَ

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