Sunan Abi Dawud, Hadith 221

‘Abd Allah b. ‘Umar reported : ‘Umar b. al-Khattab said to the Messenger of Allah (May peace be upon him) that he became sexually defiled at night (asking him what he should do). The Messenger of Allah (May peace be upon him) said : You should perform ablution and wash your penis and then sleep.

حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مَسْلَمَةَ، عَنْ مَالِكٍ، عَنْ عَبْدِ اللَّهِ بْنِ دِينَارٍ، عَنْ عَبْدِ اللَّهِ بْنِ عُمَرَ، أَنَّهُ قَالَ ذَكَرَ عُمَرُ بْنُ الْخَطَّابِ لِرَسُولِ اللَّهِ صلى الله عليه وسلم أَنَّهُ تُصِيبُهُ الْجَنَابَةُ مِنَ اللَّيْلِ فَقَالَ لَهُ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ تَوَضَّأْ وَاغْسِلْ ذَكَرَكَ ثُمَّ نَمْ ‏" ‏ ‏.‏

sunnah.com