Umm Salamah (may Allah be pleased with her) said: The Prophet (peace and blessings be upon him) came out and turned towards the mosque and said: "Beware! The mosque is not lawful for any man in a state of major impurity (janabah) or any menstruating woman, except for the Messenger of Allah (peace and blessings be upon him), Ali, Fatimah, Hasan and Husayn (may Allah be pleased with them). Beware! I have made the names clear to you so that you do not go astray."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب النكاح / 13400