‘Abdallah b. ‘Amr reported God’s Messenger as saying, “When one of you breaks wind when he has sat at the end of his prayer before giving the salutation, his prayer is valid.”
Tirmidhi transmitted it saying that this is a tradition whose isnad is not strong, and there is confusion about its isnad.
The Prophet came out for prayer, but when he had said “God is most great” he went off, giving them a sign to stay where they were. He went away, and when he had bathed he came with his head dripping and led them in prayer. Then when he finished he said, “I was defiled by a seminal emission and forgot to bathe.”
Ahmad transmitted it, and Malik transmitted it from ‘Ata’ b. Yasar in mursal form.
Talq b. ‘Ali* reported God’s Messenger as saying, “When any of you breaks wind during prayer, he must withdraw, perform ablution, and repeat the prayer.”
* This is a mistake in the text of the Mishkat. The name is ‘Ali b. Talq. Cf. Abu Dawud, Salat, 186.
Abu Dawud transmitted it, and Tirmidhi transmitted it with something added and something omitted.