In performing the fast (al-ṣawm) during the month of Ramadan, a believer is tested not only by enduring hunger and thirst, but also by controlling sexual desires. The essence of fasting is al-imsāk, a total effort to restrain oneself from everything that invalidates it from dawn until sunset.
Confusion often arises among the public regarding the limitations related to biological desire. The common understanding is that the emission of semen (inzāl) automatically invalidates the fast, regardless of the cause. However, within the detailed treasury of Shafi’i jurisprudence, not all inzāl carries the same legal consequences.
There are certain conditions where a fasting person experiences ejaculation, but their fast remains valid according to fiqh because the element of mubāsyarah (direct physical contact) is not fulfilled or due to unintentional factors.
To address this matter scientifically and authentically, we will refer to the explanation of Shaykh al-Islam Zakariyya al-Anshari in the book Asna al-Matalib Syarh Rawd at-Talib (Volume 1, page 414). This study aims to provide enlightenment so that we do not fall into unfounded doubts (waswas) in worship.
Basic Principles: The Difference Between Physical and Non-Physical Actions
In the fiqh of fasting, invalidators related to sexual desire generally require intentional physical activity. Sexual intercourse (jimak) and masturbation (istimnā’) with the hand are clear examples of physical activities that invalidate the fast because they involve active actions and contact.
However, Islamic law differentiates between physical triggers (mubāsyarah) and non-physical triggers or those beyond one’s control. This is where the subtlety of Islamic law lies, in not burdening its servants beyond their capacity.
In the book Asna al-Matalib, it is explained that the emission of semen not caused by direct contact does not invalidate the fast. The following is the original text that forms the basis of this discussion:
قوله : ( لَا ) بِالِاسْتِمْنَاءِ بِنَحْوِ ( فِكْرٍ وَ ) لَا ( نَظَرٍ وَلَا ضَمٍّ ) لِلْمَرْأَةِ أَوْ نَحْوِهَا إلَى نَفْسِهِ ( بِحَائِلٍ )
Meaning: “(And [fasting is not invalidated] by istimna’ (the emission of semen) due to mere thought, nor by looking, nor by embracing a woman or something similar to her (with a barrier).”
Based on the naṣ (text) above, we can outline three main conditions in which the emission of semen does not invalidate the fast due to the absence of direct contact or intentionality.
Three Sexual Arousals Without Physical Contact That Do Not Invalidate the Fast

Here are the details of conditions where fasting remains valid even if inzāl occurs, based on references from the book Asna al-Matalib:
1. Simply Thinking or Imagining (Fikr)
Humans are endowed with intellect and thought (khāṭir). Sometimes, thoughts leaning towards eroticism arise uncontrollably, or a person even deliberately daydreams about them.
If a person daydreams or fantasizes about things that arouse sexual desire to the point of ejaculation, then their fast remains valid and is not broken.
Legal Reasoning:
Islamic law does not punish what remains within the bounds of thought as long as it has not manifested in real action. In this case, there is no physical activity or touch (mubāsyarah) that serves as the ‘illah (legal cause) for invalidating the fast. The process of semen emission occurs solely due to the body’s internal response to thoughts.
2. Simply Looking (Nazhar)
The second condition is the emission of semen as a result of looking. This can occur when someone looks at a member of the opposite sex who is attractive to them, or looks at images/shows that arouse passion.
Even if a person repeatedly looks at the object (tikrār al-naẓar) and it is accompanied by intense lust leading to ejaculation, their fast remains valid.
Legal Reasoning:
Similar to the previous point, the absence of mubāsyarah (direct skin-to-skin contact) is a determining factor. Gazing, no matter how strong its influence on desire, is not categorized as a physical act that invalidates the fast.
3. Wet Dreams (Nocturnal Emission)

The third condition is the most common and frequently experienced, namely a wet dream (ihtilām). If someone sleeps during the day in Ramadan, then has an erotic dream that results in the emission of semen, then their fast is not invalidated at all.
Legal Reasoning:
This occurs in a state of sleep, where a person loses consciousness and control over themselves. In the principles of uṣūl al-fiqh, a sleeping person is not subject to legal responsibility (taklīf) until they awaken. The emission of semen in this condition is an involuntary act (ghayr ikhtiyārī), and therefore does not invalidate the fast.
The Sufi Perspective: Maintaining the Inner Etiquette of Fasting
Although, according to formal legal fiqh (ẓāhir), the three conditions above do not invalidate the fast, we must not forget the Sufi dimension or the inner etiquette of fasting.
A servant pursuing the maqām (station) of the fast of khawāṣ (special people) does not only guard their stomach and private parts, but also guards their heart and mind from things that distract from Allah ﷻ.
Intentionally thinking about indecent things or looking at what is Ḥarām, even if the fast is valid according to fiqh, can nullify the reward of fasting (thawāb al-ṣawm) and distance the perpetrator from the blessings of Ramadan. The Prophet Muhammad صلى الله عليه وسلم reminded us that many people who fast only get hunger and thirst from it.
Therefore, as a form of caution (wara’) and good manners towards Allah, a believer must strive to lower their gaze (ghaḍḍ al-baṣar) and manage their thoughts to remain focused on dhikr and worship during fasting.
Summary Table: Fasting Status When Semen is Ejaculated
To facilitate understanding, here is a summary table of rulings based on the book Asna al-Matalib:
| Triggers of Semen Emission (Inzal) | Direct Contact Involved? | Fasting Status According to Fiqh |
|---|---|---|
| Sexual Intercourse / Masturbation with Hand | Yes | Invalidated |
| Touching / Passionate Kissing | Yes | Invalidated |
| Merely Thinking / Daydreaming | No | Valid (Not Invalidated) |
| Merely Looking | No | Valid (Not Invalidated) |
| Wet Dream (During Sleep) | No (Unconscious) | Valid (Not Invalidated) |
FAQ: Questions About Non-Physical Sexual Arousal Triggers
If I wake up from sleep in a state of junub due to a wet dream after the subuh prayer, do I have to break my fast?
No. Your fast remains valid. Immediately perform a ritual bath (ghusl) to be able to perform the prayer, and continue your fast until maghrib.
Is it a sin to intentionally view adult content during the day of Ramadan to the point of ejaculation?
Yes, that act is clearly a sin (ḥarām) because viewing vulgar content is accompanied by lust, especially during the holy month. According to the Shafi’i school, the fast is not invalidated (because there is no physical contact), but the reward of the fast could be lost entirely.
What if semen is emitted due to embracing while wearing thick clothing (there is a barrier)?
Referring to the text Asna al-Matalib above (“…or embracing a woman… with a barrier present”), if there is a thick cloth barrier so that direct skin contact does not occur, and semen is emitted, then the fast is not invalidated. However, doing this is highly disliked (makruh) and carries a high risk.
Conclusion
The study of the book Asna al-Matalib provides enlightenment that Islamic Sharia is very detailed and just in establishing laws. Not every instance of semen emission invalidates the fast in the Shafi’i school. The key lies in the presence or absence of the element of mubāsyarah (direct physical contact) and intention. Wet dreams, merely thinking, and merely looking that results in inzāl do not invalidate the fast according to fiqh. However, as a devout servant, we are still obliged to maintain inner etiquette so that our fast is valuable in the sight of Allah ﷻ.
And Allah knows best.
Reference
Zakariyā al-Anṣārī, Asnā al-Maṭālib fī Sharḥ Rawḍ al-Ṭālib, with a ḥāshiyah by Aḥmad al-Ramlī, edited by Muḥammad az-Zuhrī al-Ghamrāwī (Cairo: al-Maṭbaʿah al-Maymānīyah, 1313 H; repr. Dār al-Kitāb al-Islāmī), volume 1, page 414.




