Co-education During The Time Of Prophet Muhammad (SWS)
It is a well known fact that the women used to say prayer in the mosque during the time of the prophet. Umm al-Muminin ‘Aisha narrated that during the time of the Prophet Muhammad ﷺ, when women finished the obligatory prayer, they would stand up. The Prophet Muhammad ﷺ and the men remained seated. When the Prophet Muhammad ﷺ stood up, the men would also stand up to complete the prayers or to leave. (Sahih Bukhari: 866) So, women were allowed to leave first.