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:1020Yaḥyá b. Ḥakīm > Abū Dāwud > Ashʿath b. Saʿīd Abū al-Rabīʿ al-Sammān > ʿĀṣim b. ʿUbaydullāh > ʿAbdullāh b. ʿĀmir b. Rabīʿah from his father

“We were with the Messenger of Allah ﷺ on a journey, and the sky was overcast so it was difficult for us to determine the Qiblah. So we performed prayer, and we marked the location.* Later, when the sun reappeared, we realized that we had prayed facing a direction other than the Qiblah. We mentioned that to the Prophet ﷺ, then the Words were revealed: ‘So wherever you turn there is the Face of Allah.’” [2:115]  

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

كُنَّا مَعَ رَسُولِ اللَّهِ ﷺ فِي سَفَرٍ فَتَغَيَّمَتِ السَّمَاءُ وَأَشْكَلَتْ عَلَيْنَا الْقِبْلَةُ فَصَلَّيْنَا وَأَعْلَمْنَا فَلَمَّا طَلَعَتِ الشَّمْسُ إِذَا نَحْنُ قَدْ صَلَّيْنَا لِغَيْرِ الْقِبْلَةِ فَذَكَرْنَا ذَلِكَ لِلنَّبِيِّ ﷺ فَأَنْزَلَ اللَّهُ {فَأَيْنَمَا تُوَلُّوا فَثَمَّ وَجْهُ اللَّهِ}  


See similar narrations below:

Collected by Tirmidhī, Bayhaqī
tirmidhi:345Maḥmūd b. Ghaylān > Wakīʿ > Ashʿath b. Saʿīd al-Sammān > ʿĀṣim b. ʿUbaydullāh > ʿAbdullāh b. ʿĀmir b. Rabīʿah from his father

"We were with the Prophet on a journey on a very dark night and we did not know the direction of the Qiblah. So each man among us prayed in his own direction. In the morning when we mentioned that to the Prophet, then the following was revealed: So where ever you turn, there is the Face of Allah."  

الترمذي:٣٤٥حَدَّثَنَا مَحْمُودُ بْنُ غَيْلاَنَ حَدَّثَنَا وَكِيعٌ حَدَّثَنَا أَشْعَثُ بْنُ سَعِيدٍ السَّمَّانُ عَنْ عَاصِمِ بْنِ عُبَيْدِ اللَّهِ عَنْ عَبْدِ اللَّهِ بْنِ عَامِرِ بْنِ رَبِيعَةَ عَنْ أَبِيهِ قَالَ

كُنَّا مَعَ النَّبِيِّ ﷺ فِي سَفَرٍ فِي لَيْلَةٍ مُظْلِمَةٍ فَلَمْ نَدْرِ أَيْنَ الْقِبْلَةُ فَصَلَّى كُلُّ رَجُلٍ مِنَّا عَلَى حِيَالِهِ فَلَمَّا أَصْبَحْنَا ذَكَرْنَا ذَلِكَ لِلنَّبِيِّ ﷺ فَنَزَلَ (فَأَيْنَمَا تُولُّوا فَثَمَّ وَجْهُ الله)  

قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ لَيْسَ إِسْنَادُهُ بِذَاكَ لاَ نَعْرِفُهُ إِلاَّ مِنْ حَدِيثِ أَشْعَثَ السَّمَّانِ وَأَشْعَثُ بْنُ سَعِيدٍ أَبُو الرَّبِيعِ السَّمَّانُ يُضَعَّفُ فِي الْحَدِيثِ وَقَدْ ذَهَبَ أَكْثَرُ أَهْلِ الْعِلْمِ إِلَى هَذَا قَالُوا إِذَا صَلَّى فِي الْغَيْمِ لِغَيْرِ الْقِبْلَةِ ثُمَّ اسْتَبَانَ لَهُ بَعْدَ مَا صَلَّى أَنَّهُ صَلَّى لِغَيْرِ الْقِبْلَةِ فَإِنَّ صَلاَتَهُ جَائِزَةٌ وَبِهِ يَقُولُ سُفْيَانُ الثَّوْرِيُّ وَابْنُ الْمُبَارَكِ وَأَحْمَدُ وَإِسْحَاقُ
tirmidhi:2957Maḥmūd b. Ghaylān > Wakīʿ > Ashʿath al-Sammān > ʿĀṣim b. ʿUbaydullāh > ʿAbdullāh b. ʿĀmir b. Rabīʿah from his father

from his father who said: "We were with the Messenger of Allah ﷺ on a journey on a very dark night and we did not know where the Qiblah was. So each man among us prayed in his own direction. In the morning when we mentioned that to the Messenger of Allah ﷺ, then the following was revealed: "So wherever you turn, there is the Face of Allah. (2:115)"  

الترمذي:٢٩٥٧حَدَّثَنَا مَحْمُودُ بْنُ غَيْلاَنَ حَدَّثَنَا وَكِيعٌ حَدَّثَنَا أَشْعَثُ السَّمَّانُ عَنْ عَاصِمِ بْنِ عُبَيْدِ اللَّهِ عَنْ عَبْدِ اللَّهِ بْنِ عَامِرِ بْنِ رَبِيعَةَ عَنْ أَبِيهِ قَالَ

كُنَّا مَعَ النَّبِيِّ ﷺ فِي سَفَرِهِ فِي لَيْلَةٍ مُظْلِمَةٍ فَلَمْ نَدْرِ أَيْنَ الْقِبْلَةُ فَصَلَّى كُلُّ رَجُلٍ مِنَّا عَلَى حِيَالِهِ فَلَمَّا أَصْبَحْنَا ذَكَرْنَا ذَلِكَ لِلنَّبِيِّ ﷺ فَنَزَلَتْ (أَيْنَمَا تُوَلُّوا فَثَمَّ وَجْهُ اللَّهِ )  

قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ غَرِيبٌ لاَ نَعْرِفُهُ إِلاَّ مِنْ حَدِيثِ أَشْعَثَ السَّمَّانِ أَبِي الرَّبِيعِ عَنْ عَاصِمِ بْنِ عُبَيْدِ اللَّهِ وَأَشْعَثُ يُضَعَّفُ فِي الْحَدِيثِ
bayhaqi:2241Abū Bakr Muḥammad b. al-Ḥusayn b. Fūrak > ʿAbdullāh b. Jaʿfar b. Aḥmad > Yūnus b. Ḥabīb > Abū Dāwud al-Ṭayālisī > al-Ashʿath b. Saʿīd Abū al-Rabīʿ And ʿUmar b. Qays > ʿĀṣim b. ʿUbaydullāh > ʿAbdullāh b. ʿĀmir b. Rabīʿah from his father

[Machine] Once, while we were traveling, darkness overtook us and the direction of the Qibla became unclear to us. Each of us prayed according to his own judgment. When it became clear, some of us had prayed in a direction other than the Qibla, while others had prayed towards the Qibla. We then mentioned this to the Messenger of Allah ﷺ , and he said, "Your prayers have passed and been accepted, for Allah says, 'And to Allah belongs the east and the west. So wherever you turn, there is the face of Allah.'" (Quran 2:115)  

البيهقي:٢٢٤١أَخْبَرَنَا أَبُو بَكْرٍ مُحَمَّدُ بْنُ الْحُسَيْنِ بْنِ فُورَكٍ أنبأ عَبْدُ اللهِ بْنُ جَعْفَرِ بْنِ أَحْمَدَ ثنا يُونُسُ بْنُ حَبِيبٍ ثنا أَبُو دَاوُدَ الطَّيَالِسِيُّ ثنا الْأَشْعَثُ بْنُ سَعِيدٍ أَبُو الرَّبِيعِ وَعُمَرُ بْنُ قَيْسٍ قَالَا ثنا عَاصِمُ بْنُ عُبَيْدِ اللهِ عَنْ عَبْدِ اللهِ بْنِ عَامِرِ بْنِ رَبِيعَةَ عَنْ أَبِيهِ قَالَ

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