(17) باب فِي اعْتِزَالِ النِّسَاءِ فِي الْمَسَاجِدِ عَنِ الرِّجَالِ
Ibn 'Umar reported the Messenger of Allah (ﷺ) as saying:
If we left this door for women (it would have been better). Nafi' said: Ibn 'Umar did not enter (the door) until his death. The other except 'Abd al-Warith said: This was said by 'Umar (and not by Ibn 'Umar) and that is more correct.
Reference: Sunan Abi Dawud 462
In-book reference: Book 2, Hadith 72
English translation: Book 2, Hadith 462