Sunan Abi Dawud, Book 2, Hadith 176 (Abu Dawud 566)

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.