And from Ali ibn Abi Talib, may Allah be pleased with him, that the Messenger of Allah (peace and blessings of Allah be upon him) was standing, leading them in prayer, when he departed. Then he returned with his head dripping [with water] and said: "I stood leading you, then I remembered that I was in a state of ritual impurity (junub) and had not performed the ghusl, so I departed and performed the ghusl. Whoever among you experiences what I have experienced, or experiences a rumbling in his abdomen, let him depart, perform the ghusl or ablution, and restart his prayer." Reported by Al-Athram. This is because he has lost a condition of prayer during its course in a manner that will not return except after a long time and much activity; thus, his prayer is invalidated, just as if he became ritually impure with an impurity whose removal requires such [actions], or his private area became exposed and he found no covering except one far from him, or he intentionally caused impurity, or the period for wiping [over socks] expired. Their hadith is weak.
Section: Our companions said: It is permissible to appoint as a successor one who was preceded by part of the prayer, and for one who comes after the Imam's impurity to build upon what has passed of the Imam's prayer in terms of recitation, a rak'ah, or a prostration, and he performs the remainder after the followers finish their prayer. This opinion was narrated from Umar, Ali, and most of those who agreed with them regarding succession. There is another narration that he is given the choice between building [upon what preceded] or starting anew. Malik said: He prays for himself a complete prayer, and when they finish their prayer, they sit and wait for him until he completes it and gives the taslim with them; because the followers' following the Imam is more appropriate than his following them, for the Imam was only appointed to be followed. According to both narrations, if the followers finish before their Imam finishes, and he stands to perform what he missed, they sit and wait for him until he completes it and gives the taslim with them, because the Imam waits for the followers in the prayer of fear (salat al-khawf), so their waiting for him is more appropriate. If they give the taslim and do not wait for him, it is permissible. Ibn Aqil said: He appoints a successor who gives the taslim with them, and it is better to wait for him. If they give the taslim, they do not need a successor, for nothing remains of the prayer except the taslim, so there is no need for succession in it. It seems stronger to me that succession is not valid in this situation, because if he builds [upon what preceded], he sits in a place other than his sitting place and becomes a follower of the congregation, and if he starts anew, the congregation sits in a place other than their sitting place, and this is not established by the Sharia. Succession is only established in the situation of consensus, where he does not need any of this, so that which is not of its meaning cannot be attached to it. And Allah knows best.
= the Book of Prayer. Sunan Abi Dawud 1/ 47, 230. It was also reported by Al-Tirmidhi, in: The Chapter on the Dislike of Approaching Women in Their Rectums, from the Chapters on Breastfeeding. 'Aridat al-Ahwadhi 5/ 111, 112. (19) Al-raz, in the original text, refers to a hidden sound, and he means by it rumbling. It is also said: it is the twitching of the impurity and its movement to exit. Al-Nihaya 2/ 219.