How did medieval Muslim armies deal with the need to pray five times a day?

by TheTromboneGeek
Cookielolz

While I can't speak for the history of it, these verses from Surah al-Nisa can at the very least tell you that Muslim armies were not expected to pray at the full length you might have expected:

And when you travel throughout the land, there is no blame upon you for shortening the prayer, [especially] if you fear that those who disbelieve may disrupt [or attack] you. Indeed, the disbelievers are ever to you a clear enemy. (101)

And when you are among them and lead them in prayer, let a group of them stand [in prayer] with you and let them carry their arms. And when they have prostrated, let them be [in position] behind you and have the other group come forward which has not [yet] prayed and let them pray with you, taking precaution and carrying their arms. Those who disbelieve wish that you would neglect your weapons and your baggage so they could come down upon you in one [single] attack. But there is no blame upon you, if you are troubled by rain or are ill, for putting down your arms, but take precaution. Indeed, Allah has prepared for the disbelievers a humiliating punishment. (102)

Also, here is a hadith from Sahih al-Bukhari:

"... a group formed a row and prayed along with him (the Prophet), and a group faced the enemy. He led the group which was along with him in a rak'ah, then remained standing while they finished the prayer by themselves. Then they departed and formed a row facing the enemy. Then the second group came and he led them in the remaining rak'ah, after which he remained seated while they finished the prayer themselves. He then led them in salutation."

Edit: It's also worth noting some of the prayers have longer intervals than others, Zuhr (The noon prayer) is able to be read at any point up till Asr (The afternoon prayer) and Isha (The night prayer) is able to be performed anywhere up till the middle of the night. So these two are much more flexible than the others which have approx. 1 hour (I can't speak for Asr, it's not as clear and different schools of thought have different opinions) within which to perform the prayer.