Reference: Fataawa Ramadhaan – Volume 2, Page 547, Fatwa No. 530
Fataawa ash-Shaykh Muhammad as-Saalih al-‘Uthaymeen – Volume 1, Page 523
Question: What is the ruling, whilst fasting, of making the ritual purification (ghusl) from the major sexual impurity (janaabah) after the time of Fajr [has entered]?
Response: We say it’s ruling is that it is permissible and his fast for that day is sound. This is because there is no problem for one to begin his fast in a state of janaabah such that even if the time of Fajr has entered and he then makes the ghusl, there is no problem. The time of Fajr used to enter upon the Messenger of Allaah ﷺ whilst he was in a state of janaaba, having spent time with one of his wives, then he used to make the ghusl and fast [and continue in his fast for the rest of the day]. In that which the Prophet ﷺ did there is no doubt to its permissibility because he ﷺ was the best of characters, and all that he did would be followed by the Ummah except if there is evidence to indicate that something is specific to him [alone] and Allaah [alone] has the Complete knowledge [of all affairs].