with them, for it will count for you as a voluntary prayer.” (1)
The Messenger of Allah ﷺ said this concerning the two men who had missed the dawn prayer, even though no prayer is to be performed after the dawn prayer.
Likewise, the prohibition is qualified in the case of the two rak‘ahs following tawaf: if a person performs tawaf, even after the afternoon prayer, it is sunnah for him to pray two rak‘ahs.
It is also qualified by making up an obligatory prayer when one has forgotten it. Thus, whoever sleeps through a prayer or forgets it, then remembers it even after the afternoon prayer, should perform it.
The general prohibition, then, has been qualified by several qualifications, which weakens its generality; thus, the hadith commanding prayer takes precedence. Accordingly, the preponderant view in this matter is that every prayer for which there is a cause should be performed whenever its cause arises, even during the prohibited times. This is the second narration from Imam Ahmad.
Second: If one begins the eclipse prayer after the afternoon prayer and the sun sets while still eclipsed, he completes it briefly, because once it has set, it is as though the eclipse has cleared.
Third: If the sun rises eclipsed, then according to the established school, the prayer is not performed until it has risen to the height of a spear. If the eclipse clears before it rises to the height of a spear, the prayer is no longer to be performed. According to the correct view, however, it should be performed immediately; if the eclipse clears before the prohibited time has ended, he completes it briefly.
Fourth: If we do not learn of its eclipse until the time of its setting, we do not pray, explaining that its authority has passed; we are now in the night, not the day, and it is a sign of the day.