Starting with the new school year in September, Gaza boys and girls in middle and high school will be breaking the law if they study side by side.

Gaza’s Islamic militant Hamas rulers argue that the new legislation, mandating gender separation in schools from age nine, enshrines common practice. But women’s activists warned Tuesday that it’s another step in the Hamas agenda of imposing its fundamentalist world view on Gaza’s 1.7 million people.

The Gaza rules appear harsh compared to Western practice but are not unusual in parts of the Arab and Muslim world. In Iraq, for example, boys and girls are required by law to study separately after age 12.

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 ultra-conservative 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 headscarves.

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 school girls 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 headscarves 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 including three Christian-run schools and the American International School, with a total enrollment of 3,500. Officials at the schools had no comment on the new law.

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.

“We warn against issuing law that change Palestinian society,” the group said.

A Gaza education official said the law is in keeping with local mores.

“We are a Muslim society and we all respect our religion,” said Walid Mezher, the Education Ministry’s legal adviser. “The aim is not to enforce Islam, as some people are saying. … It’s simply to honor the traditions and the culture of the society.”