مختصر صحيح بخاري
Mukhtasar Sahih Bukhari
Prayer of fear (Salat al-Khawf).
Narrated Abdullah bin Umar (may Allah be pleased with them): I participated in a campaign towards Najd along with the Messenger of Allah (peace and blessings of Allah be upon him). We confronted the enemy and arranged ourselves in rows for them. Then the Messenger of Allah (peace and blessings of Allah be upon him) began to lead us in prayer. One group from among us stood with him, while the other group faced the enemy. The Messenger of Allah (peace and blessings of Allah be upon him) performed one rak'ah and two prostrations with those who were with him. After that, those who had prayed with him moved to the place of the group that had not prayed. Now the second group came, and the Messenger of Allah (peace and blessings of Allah be upon him) led one rak'ah and two prostrations with them, then concluded the prayer with salam. Then each of them performed one rak'ah and two prostrations individually.
Prayer of fear can be performed walking or riding.
In another narration, Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) reports (the statement of the Messenger of Allah, peace and blessings be upon him): "If the enemy are more than them (the Muslim soldiers), then (these Muslim soldiers) should perform the prayer, whether on foot or mounted, in whatever way is possible."
Praying on mount or by gesture when pursuing or pursued by enemy.
Narrated Ibn Umar (may Allah be pleased with them): When the Prophet (peace and blessings of Allah be upon him) returned from the Battle of Ahzab, he said to us: "No one should offer the Asr prayer except at Banu Qurayza." Some people were overtaken by the time of Asr on the way, so some of them said, "We will pray now, because the Prophet (peace and blessings of Allah be upon him) did not mean for us to miss the time of Asr." So they prayed. This was mentioned to the Prophet (peace and blessings of Allah be upon him), and he did not express any displeasure towards anyone.