Anas bin Malik reported,

While we were in the mosque with the Messenger of Allah ﷺ, an Arabi came in and began urinating inside the mosque. The companions of the Messenger of Allah ﷺ exclaimed, "Stop! Stop!"The Messenger of Allah ﷺ said, "Do not interrupt him. Leave him alone."So they let him be until he finished. Then the Messenger of Allah ﷺ called him over and said to him, "These mosques are not fit for any urine or filth. They are only for the remembrance of Allah عز وجل, for prayer, and for the recitation of the Quran," or words to that effect.Then he instructed one of the men present, who brought a bucket of water and poured it over the spot.

Muslim 661

Sahih

حدثنا زهير بن حرب حدثنا عمر بن يونس الحنفي حدثنا عكرمة بن عمار حدثنا إسحق بن أبي طلحة حدثني

أنس بن مالك وهو عم إسحق قال

بينما نحن في المسجد مع رسول الله ﷺ إذ جاء أعرابي فقام يبول في المسجد فقال أصحاب رسول الله ﷺ مه مه قال قال رسول الله ﷺ لا تزرموه دعوه فتركوه حتى بال ثم إن رسول الله ﷺ دعاه فقال له إن هذه المساجد لا تصلح لشيء من هذا البول ولا القذر إنما هي لذكر الله عز وجل والصلاة وقراءة القرآن أو كما قال رسول الله ﷺ قال فأمر رجلا من القوم فجاء بدلو من ماء فشنه عليه

مسلم 661صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Purification
Chapter
Obligation of washing urine and other impurities when they occur in the masjid, and that the ground is purified by water without need to dig it up
Numbering
Darussalam 661
Muslim 661