[Machine] The Messenger of Allah ﷺ used to experience seminal emission during the night while intending to fast. He would sleep, wake up in a state of janabah (ritual impurity), wash himself with water, and complete his fast.
كَانَ رَسُولُ اللهِ ﷺ «تُصِيبُهُ الْجَنَابَةُ مِنَ اللَّيْلِ وَهُوَ يُرِيدُ الصَّوْمَ فَيَنَامُ وَيَسْتَيْقِظُ وَيُصْبِحُ جُنُبًا فَيُفِيضُ عَلَيْهِ الْمَاءَ وَيُتِمُّ صِيَامَهُ»