Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him) narrates this saying of the Prophet (peace and blessings be upon him): "A servant continues to be counted as being in prayer as long as he remains sitting at his place of prayer waiting for the prayer. The angels say: 'O Allah, forgive him; O Allah, have mercy on him,' until that servant gets up from there or ritual impurity (hadath) befalls him." The narrator says: I asked him: What is meant by ritual impurity befalling him? The teacher replied: I asked Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him) this same question, and he replied that it is when he passes wind, silently or audibly.
Imam Ahmad recorded it, and its chain contains a narrator, Ali bin Zayd bin Jud'an, about whom there is disagreement as to whether he can be used as evidence. Ibn Hibban mentioned him in the book al-Thiqat and stated that he narrates gharib (unusual) reports.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 2124