At 8am, little girls carrying backpacks stuffed with books and lunchboxes greet each other with giggles and whispers as they wait for the security guard to unlock the school gates. All are dressed in compliance with the school's regulations: skirt to the knee or below; sleeves at least to the elbow.

The youngest are six, the oldest 12: the age of innocence. But this has not protected these children from becoming the focus of a cultural, religious and territorial struggle between Jews in the city of Bet Shemesh, which many say reflects a wider battle across the country as the ultra-orthodox, or Haredim, grow in number and influence.

Since the state-funded religious-nationalist school of Orot Girls opened in new premises in September, groups of extreme Haredi men regularly gather at the gates, screaming "whore" and "slut" at the girls and their mothers. The demonstrators say they are dressed "immodestly"; that even girls as young as six should cover their flesh. When staff and pupils returned after recent holidays, they found a stink bomb had been hurled through a glass window, its stench of excrement and rotting fish putting a classroom out of use.

Women joggers have been spat at and verbally abused. A few days ago, a canvasser in her 60s, wearing shirt and trousers, was physically barred from entering an apartment block and called a whore. Signs pasted to apartment blocks near the school, occupied by Haredi families, read: "Women who pass through our neighbourhood are required to appear in modest dress."

But it is the school that has become the pivot of tensions between the religious-nationalist (Jews who are orthodox and committed Zionists) and secular communities in Bet Shemesh and their Haredi neighbours. Until this year, the school was in a decrepit downtown area; the city council agreed to relocate it next to Orot Boys and close to two mixed Jewish neighbourhoods. There was an immediate backlash from the Haredim next door.

The campaign is being driven by a small group, say parents and activists who label their opponents kanaim – loosely translated as extremist, fanatic, zealot, fundamentalist. What they do is described as "terrorism". "They instil fear, they use terror tactics," Michal Glatt, the mother of a 10-year-old pupil, says. "Screaming at little girls? What other word is there but terrorism?"

The Haredim are not interested in explaining their grievances or justifying their tactics to the media. But when community activist Rabbi Dov Lipman asked one protester why they were focusing on the way small girls dress, he was told "even an eight-year-old draws my eyes".

Some of the girls have been traumatised by the demonstrations; there has been a spike in bedwetting and nightmares. Debbie Rosen-Solow, the mother of two daughters at the school, says the Haredi protests had "definitely put a lot of stress on the children". Her six-year-old embarked on her school career believing it was normal to have police cars outside the gates. "You saw the terror on their faces," she says.

Many in the religious-nationalist and secular communities of Bet Shemesh believe the issue of "modesty" masks the crux of the campaign: to drive non-Haredim out of the area. Lipman says the drive to turn Bet Shemesh into a Haredi city could succeed: "After all, who wants their child to be assaulted verbally on a daily basis?"

According to city councillor Shalom Lerner, there were no Haredim in Bet Shemesh 20 years ago. Now they make up 40% of the population, pushed out from Jerusalem by a shortage of affordable housing, and increasing their numbers by their high birth rate. Perhaps 50 or 60 families are militant, he says: "They are a tiny number but have great influence."

The battle in Bet Shemesh is echoed in other towns and cities in Israel, as elements of the growing Haredim population attempt to impose their mores on other Jewish communities. As well as dress codes, they insist on strict observance of the Sabbath, including a ban on driving and the use of electricity, and the separation of men and women in public places, some even demanding different checkout queues in supermarkets.

Many moderate Haredim fear the extremists are tarnishing the reputation of the entire community. "They have very little understanding of the tolerance required to live in a modern society with people of mixed views," says Jonathan Rosenblum, a Haredi columnist for the Jerusalem Post, opposed to the "vandalism, taunts and threats" employed in Bet Shemesh.

He and others are critical of Moshe Abutbul, the Haredi mayor of Bet Shemesh, and other Haredim leaders, for failing to take a stand against the "zealots". Some Haredim women in the city, appalled at the actions of the extremists, distributed flowers to the pupils of Orot Girls, telling them "sister to sister" that they were beautiful.

Lipman sees the events at Orot Girls as "a microcosm of what could happen in this country. At some point they will become a majority; it's a demographic fact. We can embrace the moderates or let the extremists run wild. We have to come down on [the extremists] hard, not let them have control.

"This is definitely a battle and we need to view it that way. It's not just about the school, but the future of Bet Shemesh and the future of the state of Israel."

Comments will be switched on at 9am on Tuesday 1 November.