Bulugh al-Maram 12
وَعَنْ أَنَسِ بْنِ مَالِكٍ - رضي الله عنه - قَالَ: جَاءَ أَعْرَابِيٌّ فَبَالَ فِي طَائِفَةِ الْمَسْجِدِ, فَزَجَرَهُ النَّاسُ, فَنَهَاهُمْ النَّبِيُّ - صلى الله عليه وسلم - فَلَمَّا قَضَى بَوْلَهُ أَمَرَ النَّبِيُّ - صلى الله عليه وسلم - بِذَنُوبٍ مِنْ مَاءٍ; فَأُهْرِيقَ عَلَيْهِ. مُتَّفَقٌ عَلَيْهِ.
From Anas ibn Malik, may Allah be pleased with him, who said: A Bedouin came and urinated in a corner of the mosque, and the people rebuked him, but the Prophet ﷺ stopped them. When he had finished urinating, the Prophet ﷺ ordered a bucket of water, and it was poured over it. Agreed upon.