Answer
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
- If you prayed and had some impurity on your clothes, and you were knowledgeable of that, then your prayer is invalid.
- If you were not aware of that until after you finished your prayer, then your prayer suffices and it is not necessary for you to repeat it.
Answering your question, Sheikh Abdullah ibn Jibreen, the late prominent Saudi Muslim scholar, stated:
In case someone prayed and had some impurity on his clothes, and he was knowledgeable of that, then his prayer is invalid.
If he was not aware of that until after he finished his prayer, then his prayer suffices and it is not necessary for him to repeat it.
However, if he discovers it while praying and he can easily remove the impurity, then he should do so and continue to complete his prayer.
It is confirmed that the Prophet (peace be upon him) removed his shoes once in the prayer when the Angel Gabriel informed him that it contained some harmful matter. This did not invalidate the beginning of his prayer.
Therefore, if the impurity is on one’s headdress, he simply removes the headdress quickly and continues his prayer.
However, if the removal requires a great deal of movements, such as when removing one’s shirt, pants and so forth, then after removing it, one will have to re-begin his prayer.
The same is the case if one breaks off the prayer because he remembered that he had invalidated his ablution or if he does so in the prayer or if he invalidates the prayer by laughing and so forth.
For more, see these fatwas:
Impact of Child’s Urine on the Validity of Prayer
Forbidden Acts for Those in State of Major Impurity
Would Roadside Drain Water on Clothing Affect Prayer?
Almighty Allah knows best.
Source: Islamic Fatawa Regarding Women, Compiled by Muhammad Ibn Abdul-Aziz Al-Musnad and translated by Jamal Al-Din Zarabozo, Darussalam, 1996.