Abu Saeed Khudri reported,

While the Messenger of Allah ﷺ was leading his companions in prayer, he took off his sandals and placed them on his left side. When the people saw this, they threw off their sandals as well. After the Messenger of Allah ﷺ finished his prayer, he asked, "What made you throw off your sandals?"They replied, "We saw you take off your sandals, so we took off ours."The Messenger of Allah ﷺ said, "Jibreel عليه السلام came to me and informed me that there was filth on them," or he said, "something harmful." He continued, "When one of you comes to the mosque, let him check his sandals. If he sees filth or something harmful on them, let him wipe it off and pray in them."

Azami 1441

Sahih

عن أبي سعيد الخدري قال

بينما رسول الله ﷺ يصلي بأصحابه، إذ خلع نعليه فوضعهما عن يساره، فلما رأى ذلك القوم، ألقوا نعالهم، فلما قضى رسول الله ﷺ صلاته قال: ما حملكم على إلقائكم نعالكم؟ قالو: رأيناك ألقيت نعليك فألقينا نعالنا، فقال رسول الله ﷺ: إن جبريل عليه السلام أتاني، فأخبرني أن فيهما قذرا- أو قال: أذى، وقال: إذا جاء أحدكم إلى المسجد فلينظر، فإن رأى في نعليه قذرا، أو أذى فليمسحه وليصل فيهما.

الأعظمي 1441صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Purification
Section
Harm that afflicts the garment hem and sandals
Numbering
Jami al-Kamil 1441 (2nd edition)
Azami 1441