in it; he also instructed that one scrub the two sandals and then pray while wearing them, and he ordered that water be poured over the urine that had been spilled in the mosque. Numerous other texts likewise oblige the avoidance of impurity. Consequently, the prayer is not valid if any impurity is found on the worshipper’s body, clothing, or the spot on which he prays, and the same applies when he is carrying something that contains impurity.
If, after finishing the prayer, a person discovers impurity on himself and does not know when it appeared, his prayer is valid. The same ruling holds for someone who knew of the impurity before the prayer but forgot to remove it; according to the preponderant view, his prayer is still sound.
Should he become aware of impurity during the prayer and can remove it with only minimal movement—such as taking off his sandals, turban, and the like—he is to remove it and continue the prayer. If he is unable to do so, the prayer is invalidated.
It is impermissible to perform any prayer in a graveyard other than the funeral prayer. The Prophet (peace and blessings be upon him) said, “The whole earth has been made a place of prayer except the graveyard and the bathhouse.” This hadith was narrated by the five compilers except al-Nasaʾi, and al-Tirmidhi declared it sound.