Mishkat al-Masabih 1009, 1010
Abu Huraira said:
The Prophet came out for prayer, but when he had said “God is most great” he went off, giving them a sign to stay where they were. He went away, and when he had bathed he came with his head dripping and led them in prayer. Then when he finished he said, “I was defiled by a seminal emission and forgot to bathe.” 

Ahmad transmitted it, and Malik transmitted it from ‘Ata’ b. Yasar in mursal form.
عَنْ أَبِي هُرَيْرَةَ أَنَّ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ خَرَجَ إِلَى الصَّلَاةِ فَلَمَّا كَبَّرَ انْصَرَفَ وَأَوْمَأَ إِلَيْهِمْ أَنْ كَمَا كُنْتُمْ. ثُمَّ خَرَجَ فَاغْتَسَلَ ثُمَّ جَاءَ وَرَأَسُهُ يَقْطُرُ فَصَلَّى بِهِمْ. فَلَمَّا صَلَّى قَالَ: «إِنِّي كُنْتُ جُنُبًا فنسيت أَن أَغْتَسِل» . رَوَاهُ أَحْمد
وروى مَالك عَن عَطاء بن يسَار نَحوه مُرْسلا