It is narrated from Umm al-Mu'mineen Sayyidah Aisha (may Allah be pleased with her) that the Messenger of Allah (peace and blessings be upon him) would enter the morning in a state of major ritual impurity (janabah), then he would perform ghusl (ritual bath) and would also fast on that day.
Hadith Referenceالسنن المأثورة / باب صيام من أصبح جنبا / 294
Hadith Takhrijصحیح بخاری، الصوم، باب اغتسال الصائم، رقم : 1931 ، مسلم، الصيام، باب صحة صوم من طلع ...... الخ، رقم: 1109 صحیح