[Machine] The Messenger of Allah ﷺ prayed and took off his sandals, so the people took off their sandals. When he finished, he said, "Why did you take off your sandals?" They replied, "O Messenger of Allah, we saw you take off your sandals, so we took off ours." He said, "Indeed, Jibril came to me and informed me that there was impurity on them. So when one of you enters the mosque, let him flip over his sandals and look at them. If he sees any impurity on them, let him touch them to the ground and then pray in them."
أَنَّ رَسُولَ اللهِ ﷺ صَلَّى فَخَلَعَنَعْلَيْهِ فَخَلَعَ النَّاسُ نِعَالَهُمْ فَلَمَّا انْصَرَفَ قَالَ لِمَ خَلَعْتُمْ نِعَالَكُمْ؟ فَقَالُوا يَا رَسُولَ اللهِ رَأَيْنَاكَ خَلَعْتَ فَخَلَعْنَا قَالَ إِنَّ جِبْرِيلَ أَتَانِي فَأَخْبَرَنِي أَنَّ بِهِمَا خَبَثًا فَإِذَا جَاءَ أَحَدُكُمُ الْمَسْجِدَ فَلْيَقْلِبْ نَعْلَهُ فَلْيَنْظُرْ فِيهَا فَإِنْ رَأَى بِهَا خَبَثًا فَلْيُمِسَّهُ بِالْأَرْضِ ثُمَّ لِيُصَلِّ فِيهِمَا