The Messenger of Allah ﷺ would sometimes wake up in a state of major ritual impurity from intercourse, then he would perform the ritual bath and continue his fast that day.
حدثنا حسين بن محمد قال حدثنا الفضيل يعني ابن سليمان قال حدثنا خثيم بن عراك عن سليمان بن يسار
إن كان رسول الله ﷺ ليصبح جنبا من جماع ثم يغتسل ثم يصبح صائما