[Machine] The Messenger of Allah ﷺ sent a group, in which I was present, on a mission. Darkness fell upon us and we couldn't determine the direction of the qibla (direction of prayer). Some of the companions said that the qibla is towards the north, so pray and draw a line. Others said that the qibla is towards the south, so they prayed and drew a line. However, when morning came and the sun rose, those lines were not aligned with the qibla. We returned from our journey and went to the Prophet ﷺ and asked him about it. He remained silent and then Allah revealed the verse "To Allah belongs the east and the west. So wherever you turn, there is the face of Allah" (Surah Al-Baqarah, 2:115), which means wherever you are, that is the qibla.
بَعَثَ رَسُولُ اللهِ ﷺ سَرِيَّةً كُنْتُ فِيهَا فَأَصَابَتْنَا ظُلْمَةٌ فَلَمْ نَعْرِفِ الْقِبْلَةَ فَقَالَتْ طَائِفَةٌ مِنْهَا الْقِبْلَةُ هَاهُنَا قِبَلَ الشِّمَالِ فَصَلُّوا وَخَطُّوا خَطًّا وَقَالَ بَعْضُهُمُ الْقِبْلَةُ هَاهُنَا قِبَلَ الْجَنُوبِ وَخَطُّوا خَطًّا فَلَمَّا أَصْبَحْنَا وَطَلَعَتِ الشَّمْسُ أَصْبَحَتْ تِلْكَ الْخُطُوطُ لِغَيْرِ الْقِبْلَةِ فَقَدِمْنَا مِنْ سَفَرِنَا فَأَتَيْنَا النَّبِيَّ ﷺ فَسَأَلْنَاهُ عَنْ ذَلِكَ فَسَكَتَ وَأَنْزَلَ اللهُ ﷻ {وَلِلَّهِ الْمَشْرِقُ وَالْمَغْرِبُ فَأَيْنَمَا تُوَلُّوا فَثَمَّ وَجْهُ اللهِ} [البقرة 115] أَيْ حَيْثُ كُنْتُمْ وَكَذَلِكَ