Accordingly, the correct view is that the followers’ prayer is valid in every case so long as they are unaware of his condition, even if the imam himself knows. At times, an imam may be in a state of ritual impurity but remember it only while he is praying, and then feel too ashamed to withdraw. There is no doubt that this is forbidden for him, but it may occur among some ignorant people. If, during the prayer, the imam recalls that he is in a state of ritual impurity, or discovers that he is, he must withdraw and appoint someone to complete the prayer with them. This is because, when Abu Lu'lu'ah the Magian—the slave of al-Mughirah—stabbed Umar ibn al-Khattab, may Allah be pleased with him, after he had begun the dawn prayer, Umar took Abd al-Rahman ibn Awf by the hand and brought him forward, and he led them in a brief prayer (1). This took place in the presence of the Companions, may Allah be pleased with them all. If he does not do so and withdraws, the followers may either appoint one of themselves to complete the prayer with them or complete it individually, because their imam has left without appointing a replacement.
The second issue is praying behind one who is contaminated with impurity. The author, may Allah have mercy on him, has made its ruling the same as that of praying behind one who is in a state of ritual impurity.
Thus, if the imam prays while bearing an impurity of which neither he nor the followers are aware, and they do not discover it until the prayer has ended, then the followers’ prayer is valid, because they are excused due to ignorance. As for the imam, his prayer is invalid. He must wash away the impurity on his garment or body and then repeat the prayer, because avoiding impurity is one of the conditions for the validity of prayer. The principle is that when a condition is absent, that which depends upon it is absent.
If he discovers it during the prayer, he himself must begin the prayer anew.