The Messenger of Allah ﷺ said, "Do not prevent the female servants of Allah from attending the mosques of Allah."
حدثنا سليمان بن حرب حدثنا حماد عن أيوب عن نافع
قال رسول الله ﷺ لا تمنعوا إماء الله مساجد الله
No references are available.
Bukhari narrated it in the Book of Friday, chapter 13, hadith 900, and Muslim in the Book of Prayer, the chapter on women going out to mosques etc., hadith 442, both from the hadith of Nafi.