Ibn ‘Umar reported the Messenger of Allah (May peace be upon him) as saying; Do not prevent the female servant your women from visiting the mosques of Allah. (Using translation from Abū Dāʾūd 566)
قَالَ رَسُولُ اللهِ ﷺ لَا تَمْنَعُوا إِمَاءَ اللهِ مَسَاجِدَ اللهِ