Q:
Is it permissible to form a barrier between men and women inside the Masjid (mosque)?
This barrier is not a separate building, but it is made of wood or cloth whose length is two meters or less, which enables the women to hear the voice of the Imam (leader of congregational Prayer) and follow him in Salah (Prayer). It is just made so that they do not see men during Salah, and so that they do not commit prohibited things, such as the intermingling of men and women, which is prohibited especially during Salah.
A:
It is permissible to form a barrier between men and women inside the Masjid in the way mentioned in the question, as this is the original ruling which serves the interest, which is the separation between men and women during Salah, so that they do not get attracted to each other and become distracted from Salah. This might even lead to temptation outside the Masjid. The Prophet (peace be upon him) said that
the best rows for men are the first rows, and the worst ones the last ones; the best rows for women are the last ones, and the worst ones for them are the first ones.
(Part No. 7; Page No. 341) May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.