GAZA CITY, Gaza Strip — 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 9, enshrines common practice. 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, also have 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.