It is narrated from Nafi‘ (may Allah have mercy on him) that when ‘Abdullah ibn ‘Umar (may Allah be pleased with them both) was asked about the prayer of fear, he would say: A group will pray with the imam first, then he narrated the hadith (regarding the prayer of fear), and Ibn ‘Umar (may Allah be pleased with them both) said in this hadith: "If the danger is very great, then pray while walking and on your mount, facing the qiblah and not facing the qiblah (pray in any direction)." Imam Malik (may Allah have mercy on him) says that Nafi‘ said that ‘Abdullah ibn ‘Umar (may Allah be pleased with them both) narrated this from the Prophet ﷺ.
Hadith Referenceمسند الإمام الشافعي / كتاب الصلاة / 371
Hadith Takhrijأخرجه البخاري: التفسير، باب قوله فإن خفتم فرجالًا أو ركبانًا... إلخ (4535).