Wa `alaykum As-Salamu waRahmatullahi wa Barakatuh.
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:
1- If what you experienced – i.e. sexual arousal and discharge of sexual fluid – was involuntary, which means that this did not happen by your own free will, you bear no sin for that.
2- If the sexual fluid was discharged from you involuntarily, your fast was not invalidated by that.
Answering your question, The Fatwa Center at Islamweb, states:
We implore Allah to alleviate your hardship, relieve your distress, preserve you religiosity and honor, and unite you with your husband. Verily, Allah is near and answers people’s supplications. We advise you to adhere to patience and to supplicate Allah. Indeed, He answers the supplications of the distressed and relieves hardship. Allah says:
“Is He [not best] who responds to the desperate one when he calls upon Him and removes evil and makes you inheritors of the earth? Is there a deity with Allah? Little do you remember.” (An-Naml 27:62)
If what you experienced – i.e. sexual arousal and discharge of sexual fluid – was involuntary, which means that this did not happen by your own free will, you bear no sin for that. Allah says: “And there is no blame upon you for that in which you have erred but [only for] what your hearts intended. And ever is Allah Forgiving and Merciful.” (Al-Ahzab 33:5)
Ibn `Abbas (may Allah be pleased with him) related that the Prophet (peace be upon him) said: “Verily, Allah has pardoned my nation for what they do by mistake, out of forgetfulness, and what they do under coercion.” (Ibn Majah)
If the sexual fluid was discharged from you involuntarily, your fast was not invalidated by that.
As for seeing a wet dream, one bears no sin for that and his fasting is not invalidated because the deeds of a person while sleeping are not recorded (i.e. he will not be held accountable before Allah for what he does or says during sleep).
‘A’ishah (may Allah be pleased with her) narrated that the Prophet (peace be upon him) said: “The pen has been lifted (i.e. the actions are not recorded) for three: the sleeping person until he awakens, a child until he reaches puberty, and an insane person until he regains sanity or comes to his senses.” (Abu Dawud, An-Nasa’i, and Ibn Majah)
Allah Almighty knows best.
Editor’s note: This fatwa is from Ask the Scholar’s archive and was originally published at an earlier date.