Wa `alaykum as-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
1- Your fast is valid as long as you have the intention to fast and it is permissible to delay ghusl until the time of Fajr.
2- In the case of ghusl following intercourse, it is recommended for the husband and wife to perform wudu’ before they sleep and to perform ghusl as soon as they can so that they can pray.
In his response to your question, Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
Islam is the religion of cleanliness. Allah Almighty says: “Truly Allah loves those who turn unto Him, and loves those who have a care for cleanness) (Al-Baqarah 2:222)
The Prophet (peace and blessings be upon him) is reported to have said, “Cleanliness is half of faith.” (Muslim)
Your fast is considered valid as long as you had the intention to fast. Although you should wake up for sahur as there is a great blessing in it, if you happened to wake up late and you did not bathe following impurity due to sexual relations or menses, your fast is considered valid.
We are told in the authentic reports from `A’ishah, the Mother of the Believers and the beloved wife of the Prophet (may Allah be pleased with her) that the Prophet (peace and blessings be upon him) would wake up sometimes in a state of sexual impurity and yet would be fasting, but he would bathe prior to performing Fajr Prayer.
Allah Almighty knows best.
Excerpted, with slight modifications, from, www.islam.ca