[Machine] Narrated by the Prophet ﷺ, he prayed two rak'ahs with these people and two rak'ahs with those people during the prayer of fear. This was mentioned in a condensed form by Simak, and it has also been narrated by Salim and Nafi' from Ibn Umar, that each group completed their prayer. The ruling is that it is established in cases like this, and with Allah is the success.
عَنِ النَّبِيِّ ﷺ أَنَّهُ صَلَّى بِهَؤُلَاءِ رَكْعَةً وَبِهَؤُلَاءِ رَكْعَةً فِي صَلَاةِ الْخَوْفِ كَذَا أَتَى بِهِ سِمَاكٌ مُخْتَصَرًا وَقَدْ رُوِّينَاهُ عَنْ سَالِمٍ وَنَافِعٍ عَنِ ابْنِ عُمَرَ أَنَّ كُلَّ وَاحِدَةٍ مِنَ الطَّائِفَتَيْنِ قَضَوْا رَكْعَتَهُمْ وَالْحُكْمُ لِلْإِثْبَاتِ فِي مِثْلِ هَذَا وَبِاللهِ التَّوْفِيقُ