What is the ruling on making utterances in prayer due to causes unrelated to the prayer itself, such as praising God upon sneezing or exclaiming 'Inna Lillahi wa inna ilayhi raji'un' upon hearing grievous news?
Chapter on the Two Prostrations of Forgetfulness
Al-Mughni
Book of Prayer
Primary text
Utterances made in prayer due to external causes—such as praising God upon sneezing, saying 'Bismillah' upon being stung by a scorpion, or saying '{Inna Lillahi wa inna ilayhi raji'un}' (Quran 2:156) upon hearing distressing news, or saying 'Subhan Allah' upon witnessing something astonishing—are neither recommended nor do they invalidate the prayer. Ahmad narrated in the primary report that the prayer is not nullified if one praises God upon sneezing. Similarly, if one is informed during prayer of a birth and says 'Alhamdulillah', or of a fire and says 'La ilaha illa Allah', or of a loss and says 'La hawla wa la quwwata illa billah', or of a death and says '{Inna Lillahi wa inna ilayhi raji'un}', the prayer stands, and repetition is not required. This view is held by Al-Shafi'i and Abu Yusuf. Evidence for this includes the narration where a young man sneezed behind the Prophet (peace be upon him) and offered extensive praise, to which the Prophet (peace be upon him) replied that no harm was done. Also, the narration concerning Ali (may God be pleased with him) responding to a Kharijite while praying.
Supporting text
Abu Hanifa holds that the prayer is invalidated because such utterances constitute human speech. A narration from Ahmad suggests a similar ruling if the praise is complete ('Alhamdulillah Rabbil-'Alamin') or if the utterance concerns a calamity. Al-Qadi interprets this latter view as applying only when the speaker intends to address another human being. The ruling is that the reciter should not raise their voice when praising God upon sneezing, though raising it is permissible based on the Ansari’s hadith. If followers respond to the Imam saying 'La ilaha illa Allah' by saying it themselves, it is permitted if kept quiet, but if they raise their voices, it is disliked, although the Imam should not forbid them as it resembles saying 'Amen'.