Ruling on the fast of one who thinks about sex then ejaculates

Dear Brothers & Sisters,
As-Salaamu-Alaikum wa Rahmatullahi wa Barakatuh. (May Allah's Peace, Mercy and Blessings be upon all of you)
One of our brothers/sisters has asked this question:

If a man was sitting and thinking (about sex), then he went to sleep and ejaculated, whilst he was fasting during the day in Ramadaan, does that invalidate his fast, and does he have to make it up?

(There may be some grammatical and spelling errors in the above statement. The forum does not change anything from questions, comments and statements received from our readers for circulation in confidentiality.)
Check below answers in case you are looking for other related questions:

Answer:

Praise be to Allaah.

Whoever thinks about sex and ejaculates, or has a wet dream and ejaculates, that does not invalidate his fast, but he has to do ghusl from janaabah, because when Umm Sulaym asked him, “Does a woman have to do ghusl if she has a wet dream?” the Prophet (peace and blessings of Allaah be upon him) said, “Yes, if she sees water.” 

The same ruling applies to men, because the Prophet (peace and blessings of Allaah be upon him) said: “Water is for water.” 

With regard to his fast, it is valid, because a wet dream is not something that happens by choice. Similarly, thinking is something which is forgiven by Allaah, because the Prophet (peace and blessings of Allaah be upon him) said: “Allaah has forgiven my ummah for wrong thoughts that cross their minds, so long as they do not speak of them or act upon them.” 

This is all kindness from Allaah. 

Whatever written of Truth and benefit is only due to Allah's Assistance and Guidance, and whatever of error is of me. Allah Alone Knows Best and He is the Only Source of Strength.

Related Answers:

Recommended answers for you: