that one who sleeps through the prayer must pray it upon awakening, and one who forgets it must pray it upon remembering. According to the majority of them—including Mālik, Ahmad ibn Hanbal, Abū Hanīfa, and others—the missed prayer must be made up immediately. Al-Shāfiī, however, does not require the sleeper or the one who forgets to make it up immediately. And whoever (1) forgets one of its obligatory requirements is in the same position as one who forgets the prayer itself. Thus, if someone prays and then, after the prayer’s time has elapsed, remembers that he had not been in a state of ritual purity, he must repeat it. This is just as Umar, Uthmān, and others repeated their prayers after having led the people in prayer and subsequently remembering that they had been in a state of major ritual impurity; they did not, however, instruct those who had prayed behind them to repeat their prayers.
The hadith concerning Umar states that he did not remember until after sunrise (2).
The same applies when someone delays the prayer because he believes such a delay to be permissible. Thus, on the Day of the Confederates, the Prophet—may Allah bless him and grant him peace—delayed it and prayed it after sunset (3). That delay must have been either due to forgetfulness on his part or because it was permissible for them to delay the prayer when they were occupied in fighting the enemy.