Hamas has been running Gaza since its violent takeover of the crowded coastal territory in 2007. While the group advocates the establishment of an Islamic state in all of the Mideast, including Israel, it has moved cautiously in spreading its ultraconservative version of Islam.
It has issued a series of rules restricting women or requiring them to cover up in the traditional Islamic dress of long robes and head scarves.
Other edicts include bans on women smoking water pipes in public, riding on the backs of motorcycles, or getting their hair done by male stylists. Last month, it barred girls and women from participating in a U.N.-sponsored marathon, prompting a U.N. aid agency to cancel the race.
Hamas activists, including teachers, have also exerted social pressure to get all schoolgirls to wear Islamic dress.
When faced with public resistance, Hamas tends to refrain from enforcing the rules. It scrapped a 2009 decree requiring female lawyers to wear head scarves in court after women protested.
"In the last six years, Hamas has been going forward - and sometimes a step backward because of protests - but there is a strategy to implement the Islamic law in society," said Mkhaimar Abu Sada, a Gaza political analyst and university lecturer.
In conservative Palestinian society, the idea of gender segregation in schools from the onset of puberty is widely accepted. Even in the West Bank, run by a more liberal Western-backed self-rule government, most public schools separate boys and girls by fourth grade.
But in the West Bank, separation is not mandated by law. Instead, it's up to local authorities to decide according to residents' sensibilities.
The new Gaza law, approved Monday, deprives teachers and parents of that choice, and in principle imposes segregation on four private schools that have boys and girls studying together into middle or high school. They include three Christian-run schools and the American International School, with a total enrollment of 3,500. Officials at the schools had no comment.
A prominent women's rights group on Tuesday denounced the legislation.
The bill is "based on a culture of discrimination against women, by reinforcing gender separation which takes our society back to ancient times when there was no respect for women's rights and women were eliminated from public life," said the Center for Women's Legal Research and Consulting, Gaza's only legal-aid group for women.