[Machine] The Messenger of Allah ﷺ said: "Whoever believes in Allah and the Last Day should honor his guest. And whoever believes in Allah and the Last Day, should honor his neighbor. And whoever believes in Allah and the Last Day, should not enter the bathroom without a garment. And whoever believes in Allah and the Last Day, the women should not enter the public baths." The hadith was then conveyed to 'Umar ibn 'Abdul 'Aziz, who wrote to Abu Bakr ibn Muhammad ibn 'Amr ibn Hazm, asking him to ask Muhammad ibn Thabit about this hadith and write down what he said. 'Umar ibn 'Abdul 'Aziz then wrote that women are to be prohibited from the public baths.
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ «مَنْ كَانَ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الْآخِرِ فَلْيُكْرِمْ ضَيْفَهُ وَمَنْ كَانَ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الْآخِرِ فَلْيُكْرِمْ جَارَهُ وَمَنْ كَانَ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الْآخِرِ فَلَا يَدْخُلِ الْحَمَّامَ إِلَّا بِمِئْزَرٍ وَمَنْ كَانَ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الْآخِرِ مِنْ نِسَائِكُمْ فَلَا تَدْخُلِ الْحَمَّامَاتِ» فَرُفِعَ الْحَدِيثُ إِلَى عُمَرَ بْنِ عَبْدِ الْعَزِيزِ فَكَتَبَ إِلَى أَبِي بَكْرِ بْنِ مُحَمَّدِ بْنِ عَمْرِو بْنِ حَزْمٍ أَنْ سَلْ مُحَمَّدَ بْنَ ثَابِتٍ عَنْ هَذَا الْحَدِيثِ وَاكْتُبْ بِمَا قَالَ فَفَعَلَ فَكَتَبَ عُمَرُ بْنُ عَبْدِ الْعَزِيزِ أَنْ تُمْنَعَ النِّسَاءُ الْحَمَّامَاتِ