Sayyidah Aishah (may Allah be pleased with her) says that a man came to the Prophet (peace and blessings be upon him) seeking a ruling, and I was listening from behind the door. He said: "O Messenger of Allah, the prayer time comes upon me while I am in a state of janabah; may I fast?" The Messenger of Allah (peace and blessings be upon him) said: "The prayer comes upon me too while I am in a state of janabah, and I fast." He said: "You (peace and blessings be upon him) are not like us; Allah has forgiven your (peace and blessings be upon him) past sins and later ones." He (peace and blessings be upon him) said: "By Allah, I hope that I am the most fearful of Allah among you all, and that I know best what I should guard against."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصيام / 7990