Sahih Muslim, Book 4, Hadith 152 (Muslim 983)

Ibn 'Umar reported:

'The Messenger of Allah (ﷺ) said: Do not prevent the maid-servants of Allah from going to the mosque.