Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) narrates from Sayyiduna Umar (may Allah be pleased with him) that he said: The Messenger of Allah (peace and blessings be upon him) said: "Do not prevent the female servants of Allah from the mosques of Allah."
Imam Muslim (may Allah have mercy on him) narrated it as a hadith of Ubaydullah bin Umar (may Allah have mercy on him), through Nafi' (may Allah have mercy on him), from Sayyiduna Ibn Umar (may Allah be pleased with them both), from the Prophet (peace and blessings be upon him).
Also, Imam al-Bukhari (may Allah have mercy on him) narrated it from Yusuf bin Musa al-Qattan (may Allah have mercy on him), from Abu Usamah (may Allah have mercy on him), through Ubaydullah (may Allah have mercy on him), as a hadith of Sayyiduna Ibn Umar (may Allah be pleased with them both).