I had a wet dream on a cold night during the expedition of Dhat al-Salasil. I feared that if I bathed I would perish, so I performed tayammum and then led my companions in the dawn prayer. They mentioned this to the Prophet ﷺ, who said, "Amr, did you lead your companions in prayer while you were in a state of major impurity?"I told him what had prevented me from bathing and said, "I heard Allah say, 'And do not kill yourselves. Indeed, Allah is ever Merciful to you' [Nisa 4:29]."The Messenger of Allah ﷺ laughed and said nothing.
حدثنا ابن المثنى أخبرنا وهب بن جرير أخبرنا أبي قال سمعت يحيى بن أيوب يحدث عن يزيد بن أبي حبيب عن عمران بن أبي أنس عن عبد الرحمن بن جبير المصري
احتلمت في ليلة باردة في غزوة ذات السلاسل فأشفقت إن اغتسلت أن أهلك فتيممت ثم صليت بأصحابي الصبح فذكروا ذلك للنبي ﷺ فقال يا عمرو صليت بأصحابك وأنت جنب فأخبرته بالذي منعني من الاغتسال وقلت إني سمعت الله يقول {ولا تقتلوا أنفسكم إن الله كان بكم رحيما} فضحك رسول الله ﷺ ولم يقل شيئا
Graded sahih. Ahmad narrated it in 4/203 through Yazid bin Abu Habib, and Bukhari mentioned it in a suspended form before hadith 345. Ibn Hibban graded it sahih in hadith 202, and Hakim graded it as meeting the standard of the two Shaykhs in 1/177, and Dhahabi agreed with him.