What is the ruling regarding someone who knew of the contamination but forgot it until after completing the prayer?
Chapter on Praying with Impurity and Other Matters
Al-Mughni
Book of Prayer
Primary text
The preferred view is that there is no distinction between ignorance and forgetfulness, and one who forgets is excused, especially since textual evidence grants pardon for error and forgetfulness by the statement of the Prophet, peace be upon him, 'My Ummah has been pardoned for error and forgetfulness.' If one discovers contamination during the prayer and removes it without excessive time passing or significant intervening actions, the prayer stands valid, following the example of the Prophet removing his sandals.
Supporting text
Some jurists, like the author stated by Al-Qāḍī, consider the prayer invalidated in the case of forgetfulness because it is attributed to negligence, unlike genuine ignorance. Furthermore, if removing the contamination during the prayer requires either a long pause or excessive action, the prayer is invalidated because it leads to either knowingly persisting in impurity or performing excessive non-prayer actions.