as in the cases discussed above, because praying within the appointed time after dry ablution is better than praying afterward with a ritual bath. The correct view, however, is that of the majority, because for someone who has been asleep, the appointed time begins when he wakes up. As the Prophet, may Allah bless him and grant him peace, said:
“Whoever sleeps through a prayer or forgets it, let him pray it when he remembers it, for that is its appointed time.”
Thus, for someone who has been asleep, the appointed time begins when he wakes up; the period before that was not its appointed time for him. Accordingly, if he wakes before sunrise but cannot take a ritual bath and pray until after sunrise, he has prayed within his appointed time and has not missed it. This is unlike someone who wakes at the beginning of the appointed time: for him, the appointed time is before sunrise, so he may not let the prayer’s time pass.
Likewise, someone who has forgotten a prayer and then remembers it should take a ritual bath and pray at that point, whatever time it may be, for that is its appointed time for him. If he does not wake until after sunrise—as happened to the Prophet’s Companions, may Allah bless him and grant him peace, when they slept through the prayer in the year of Khaybar—he should pray with complete ritual purification, even if he delays the prayer until the sun passes its zenith. Thus, supposing he is in a state of major ritual impurity, he should enter the bathhouse and take a ritual bath, even if he delays the prayer until nearly that time. He should not pray after dry ablution in this case.
It is recommended that he move away from the place where he slept, just as the Prophet, may Allah bless him and grant him peace, and his Companions moved away from the place where they had slept. He said:
“This is a place where Satan was present among us.”
Ahmad and others explicitly stated this. If, however, he prays there, his prayer is valid.