Scholars hold three views on this matter:
One view is that a person must pray during combat and must not delay the prayer (1), and that the postponement at the Battle of the Trench was abrogated. This is the position of Mālik, al-Shāfiī, and Imam Ahmad according to the view commonly reported from him.
Another view is that one may choose either to perform it at its prescribed time or to delay it. When the Prophet—may Allah bless him and grant him peace—instructed his Companions not to pray the afternoon prayer until they reached Banū Qurayza, one group of them delayed (2) the prayer and performed it after sunset. Another group said, “He intended only that we hasten toward the enemy, not that we miss (3) the prayer.” They therefore prayed along the way. The Prophet—may Allah bless him and grant him peace—did not rebuke either group.
The hadith is recorded in both Sahīh collections on the authority of Ibn Umar (4). This is the view of a group of Syrian scholars and others, and it is one of the two reports from Ahmad.
A third view is that they should delay it, just as the Prophet did on the Day of the Trench. This is the position of Abū Hanīfa. In short, anyone who delays the prayer in circumstances for which he is excused—whether because of forgetfulness or an error in independent legal reasoning—must pray it after its prescribed time. This is like someone who thinks that the sun has not yet risen and delays the prayer until it rises, or someone who thinks that the time for the afternoon prayer remains and delays it until the sun sets; such a person must pray it.
According to the majority, however, it is no longer permissible to delay the prayer until sunset. Whoever maintains that delaying it is permissible must still pray it; even if he delayed it on the basis of his own independent judgment, he must pray it. And even if it is said that he erred in his independent judgment (5), such a person is not among those subject to the threat of punishment