(1) The Book of Purification
كتاب الطهارة
(8) Chapter: Taking Ghusl (bath) And the precepts regarding Sexual Impurity
(8) باب الغسل وحكم الجنب
Bulugh al-Maram 122 
Narrated `A'ishah (RAA):
Allah's messenger (ﷺ) said: "It is not permitted for a menstruating woman or one who is junub (sexually impure) to stay in the mosque." Related by Abu Dawud and Ibn Khuzaimah graded it as Sahih
وَعَنْ عَائِشَةَ رَضِيَ اَللَّهُ عَنْهَا قَالَتْ: قَالَ رَسُولُ اَللَّهِ ‏- صلى الله عليه وسلم ‏-{ إِنِّي لَا أُحِلُّ اَلْمَسْجِدَ لِحَائِضٍ وَلَا جُنُبٌ } رَوَاهُ أَبُو دَاوُدَ, وَصَحَّحَهُ اِبْنُ خُزَيْمَة َ 1‏ .‏


‏1 ‏- ضعيف.‏ رواه أبو داود (232)‏، وابن خزيمة (1327)‏.‏

Reference : Bulugh al-Maram 122
In-book reference : Book 1, Hadith 149
English translation : Book 1, Hadith 132