Abu Hurairah reported,

An Arabi entered the mosque while the Messenger of Allah ﷺ was sitting, and he said, "O Allah, forgive me and Muhammad, and do not forgive anyone else along with us."The Messenger of Allah ﷺ laughed and said, "You have confined something vast."Then the man turned away, and when he reached a corner of the mosque, he spread his legs and began to urinate.The Arabi later said, after he had gained understanding, "He came to me, may my father and mother be sacrificed for him, and he neither rebuked me nor insulted me. He simply said, 'This mosque is not a place for urinating. It was built only for the remembrance of Allah and for prayer.' Then he called for a bucket of water and poured it over my urine."

Ibn Majah 529

Hasan

حدثنا أبو بكر بن أبي شيبة حدثنا علي بن مسهر عن محمد بن عمرو عن أبي سلمة

عن أبي هريرة قال

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

ابن ماجه 529حسن
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Purification and its sunnahs
Chapter
Ground that is affected by urine, how it is washed
Numbering
Darussalam 529
Ibn Majah 529