one rakʿah, give the salām, then withdraw to the place where their companions are stationed. They join the prayer behind the imam while he is still standing; he leads them in a single rakʿah, after which each of them completes two rakʿahs on his own.
If the imam prefers, he may remain seated after the tashahhud and wait for them until he senses their presence; he then rises, they pronounce the opening takbīr behind him, and he continues the prayer. Alternatively, he may stand up for his third rakʿah straightaway and wait in that position; once they have entered the prayer behind him, he leads them in one rakʿah.
Should the prayer be performed while they are resident rather than travelling, they must perform it in full. In that case he is to wait for them when he rises for the third rakʿah; this is the view most commonly reported from Mālik. Even so, were he to wait for them while seated, as described earlier, there would be no objection.
If the enemy stands between them and the qiblah, close enough that they can see any charge he might make, the imam forms the Muslims into two rows and leads them all together. The second row keeps watch while the first row is in prostration; once the first row rises, the second row prostrates, following the imam, and he concludes with the salām for everyone at once.
When the danger is still greater and full combat is joined, they may pray on foot or mounted, moving at a walk or a gallop, facing the qiblah or not—each according to his ability. In such a case they merely indicate the bowing and prostration with gestures. They must, however, recite Sūrat al-Fātiḥah in at least one rakʿah, and they are not required to repeat the prayer once safety returns, except for anyone who deems his own prayer deficient; such a person should complete it in its normal form, and if he prefers to begin it anew that is commendable and, to me, preferable.
A person who fears a bandit or a wild beast while riding may pray on his mount, whether or not he faces the qiblah, provided he is certain of the danger. If the matter is uncertain and he later feels safe, he must repeat the prayer.
If a force is routed because it is weaker or smaller in number, yet its members are not turning aside to engage the enemy nor regrouping with another unit, it is not permissible for them to perform the prayer of extreme fear. Allah knows best.