BEIT SHEMESH, Israel — Orthodox and other Jewish women in Beit Shemesh, a fast-growing, ultra-Orthodox stronghold, have been stoned, pepper-sprayed, spat on or called “whore” by puritanical Jews who take their beliefs about modesty to violent extremes. So the election this week of a woman as mayor — with the support of thousands of ultra-Orthodox voters who defied their rabbis to support her — was felt across this hilly city like nothing less than an earthquake.

Aliza Bloch, a 51-year-old former high school principal, didn’t just defeat the two-term incumbent, an ultra-Orthodox man who enjoyed the backing of rabbis from the dominant sects. She did it by uniting nonreligious longtime residents angry about being turned into minorities in their own city, English-speaking Orthodox immigrants impatient with inadequate government services, and forward-thinking ultra-Orthodox who were both sick of being denigrated as not religious enough and embarrassed by the bad press that Beit Shemesh has earned as a hotbed of religious fanaticism.

“Until now, radicals controlled the discourse,” Ms. Bloch told a cheering crowd of supporters who had waited around till after 3 a.m. Thursday for her razor’s-edge victory to be assured with the counting of absentee ballots. “They prevented us from seeing one another as human beings. Until today, they were the ones who set the tone.”

But no longer, she vowed: From now on, the city would become a model for all Israel. “We’ve realized that we share a common good that unites us,” Ms. Bloch said, adding: “No more ‘I take care of the people in my sector.’ We’re done with that sort of talk in Beit Shemesh.”