Hadith 185

Riyad as-Salihin

Book 17: The Book of the Prohibited actions

Chapter 309

Prohibition of Spitting in the Mosque

باب النهي عن البصاق في المسجد والأمر بإزالته منه إذا وجد فيه، والأمر بتنزيه المسجد عن الأقذار

Riyad as-Salihin 1695
وعن أنس رضي الله عنه أن رسول الله صلى الله عليه وسلم قال‏:‏ ‏ ‏ أو كما قال رسول الله صلى الله عليه وسلم ‏.‏ ‏(‏‏(‏رواه مسلم‏)‏‏)‏‏.‏
"‏إن هذه المساجد لا تصلح لشيء من البول ولا القذر، إنما هي لذكر الله تعالى، وقراءة القرآن‏"
Anas (May Allah be pleased with him) said:

The Messenger of Allah (ﷺ) said, "It is not proper to use the mosque for urinating or easing oneself. They are merely built for the remembrance of Allah and the recitation of the Qur'an", or as he stated.[Muslim].