This excerpt is taken from the book of Fadhilat al-Shaykh Mubashir Ahmad Rabbani, may Allah have mercy on him, Ahkam and Masail of Ramadan.
If a person experiences wet dreams during the day, does it invalidate the fast?
Question:
If a fasting person experiences wet dreams during the day in Ramadan, does it invalidate their fast or not? And is it obligatory for them to perform ghusl immediately?
Fatwa:.
Wet dreams do not invalidate the fast because this matter is not within the control of the fasting person. However, in this case, it is obligatory to perform ghusl (ritual purification) if one sees semen. If one has a wet dream after Fajr prayer and delays the ghusl until the time of Dhuhr prayer, there is no harm in that. Similarly, if one has sexual relations with their wife at night and performs ghusl after the break of dawn, there is also no harm in that. It is established from the Prophet (peace be upon him) that he would wake up in a state of major impurity after having sexual relations, then bathe and fast. The same applies to women who are menstruating or in postpartum bleeding. If they become pure at night and bathe after the break of dawn, there is no harm in that, and their fast will be valid. However, it is not permissible for them or for someone in a state of major impurity to delay until sunrise or the Fajr prayer. Rather, it is obligatory for all of them to hasten in bathing so that they can perform the Fajr prayer on time before sunrise. It is also necessary for a man to quickly complete the ghusl from major impurity so that he can perform the Fajr prayer in congregation, and indeed, it is Allah who grants success.