Ejaculation From Masturbation After Fajr Adhan: Is the Fast Valid
Question

I engaged in masturbation, and when I heard the call to the dawn prayer, I stopped immediately, but when I stopped, semen was discharged. Is my fasting valid?
Praise be to Allah.Firstly:
Masturbation is prohibited, and repentance is required for it.
Please see the answer to question number: (329 ).
Secondly:
If you refrained from masturbation at the time of the Fajr call to prayer, and then semen was discharged involuntarily afterward: your fasting is valid.
Scholars (may Allah have mercy on them) have stated a similar issue, which is concerning someone who had intercourse at night and then ejaculated during the day, and they said: His fast is valid.
It is stated in "Al-Jawhara An-Nayyira" (1/138), which is a Hanafi text: "If one who had intercourse feared the dawn's arrival, so he withdrew, and then ejaculated after dawn: he has not broken his fast." End quote.
And in "Hashiyat Ad-Dasouqi" (1/523), a Maliki text, it says:
"If he had intercourse at night, and his semen was discharged after dawn: the apparent ruling is that there is nothing upon him, just as if someone applied kohl at night, and then the kohl reached his throat during the day." End quote. Similar statements are found in "Sharh Al-Kharshi on Mukhtasar Khalil" (2/249).
Al-Bahuti said in Kashshaf Al-Qina` (2/321), a Hanbali text: "(Or if he ejaculates during the day from intercourse at night) he has not broken his fast; because he did not cause it during the day, or if he ejaculates at night from foreplay during the day: there is no breaking of the fast in all of that." End quote.
And Allah knows best.