Ibn ‘Umar told how ‘Umar b. al-Khattab mentioned to God’s messenger that he was affected by seminal defilement during the night, and was told to perform ablution, wash his penis, and go back to sleep.
God’s messenger met me when I was sexually defiled, took my hand and I walked with him. When he sat down I withdrew, and after I had gone home and washed I came back and found the Prophet still seated. He asked, “Where have you been, Abu Huraira?” I told him, and he said, “Glory be to God! The believer does not become impure.”
This is Bukhari's wording and Muslim has something to the same effect, but after “I told him” he adds: I said to him, “You met me when I was sexually defiled, and I did not like to sit with you till I had washed.” Bukhari has the same in another version.
وَعَن عبد الله بن عمر قَالَ كَانَتِ الصَّلَاةُ خَمْسِينَ وَالْغُسْلُ مِنَ الْجَنَابَةِ سبع مرار وَغسل الْبَوْل من الثَّوْب سبع مرار فَلَمْ يَزَلْ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يُسْأَلُ حَتَّى جعلت الصَّلَاة خمْسا وَالْغسْل من الْجَنَابَة مرّة وَغسل الْبَوْل من الثَّوْب مرّة. رَوَاهُ أَبُو دَاوُد
Ibn ‘Umar said that the original requirement was fifty times of prayer, seven washings to remove sexual defilement, and seven washings when urine fell on a garment. God’s messenger therefore kept on making requests till five times of prayer were appointed, one washing for sexual defilement, and one washing of a garment because of urine.