Abu Huraira reported that he met the Messenger of Allah (ﷺ) on one of the paths leading to Medina in a state of (sexual) defilement and he slipped away and took a bath. The Apostle of Allah (ﷺ) searched for him and when he came, he said to him
0 Abu Huraira, where were you? He said: Messenger of Allah, you met when I was (sexually) defiled and I did not like to sit in your company before taking a bath. Upon this the Messenger of Allah (ﷺ) said: Hallowed be Allah, verily a believer is never defiled.
Hudhaifa reported
The Messenger of Allah (ﷺ) happened to meet him and he was (sexually) defiled, and he slipped away and took a bath and then came and said: I was (sexually) defiled. Upon this he (the Holy Prophet) remarked: A Muslim is never defiled.