The simple act of walking has become a display of defiance for a young Iranian woman who often moves in Tehran's streets without a compulsory headscarf, or hijab.

With every step, she risks harassment or even arrest by Iran's morality police whose job is to enforce the strict dress code imposed after the 1979 Islamic Revolution.

"I have to confess it is really, really scary," the 30-year-old fire-safety consultant said in a WhatsApp audio message, speaking on condition of anonymity for fear of repercussions.

But she is also hopeful, saying she believes the authorities find it increasingly difficult to suppress protests as more women join in. "They are running after us, but cannot catch us," she said. "This is why we believe change is going to be made."

The hijab debate has further polarized Iranians at a time when the country is buckling under unprecedented United States sanctions imposed since the Trump administration pulled out of a 2015 nuclear deal between Iran and world powers last year. It's unclear to what extent the government can enforce hijab compliance amid an economic malaise, including a currency collapse and rising housing prices.

There's anecdotal evidence that more women are pushing back against the dress code, trying to redefine red lines as they test the response of the ruling Shiite Muslim clergy and their security agencies.

An Associated Press reporter spotted about two dozen women in the streets without a hijab over the course of nine days, mainly in well-to-do areas of Tehran – a mall, a lakeside park, a hotel lobby.

Many other women, while stopping short of outright defiance, opted for loosely draped colorful scarves that show as much hair as they cover. Even in Tehran's Grand Bazaar, frequented by many traditional women, most female shoppers wore these casual hijabs. Still, a sizeable minority of women was covered head-to-toe in black robes and tightly pulled headscarves, the so-called chador.

The struggle against compulsory headscarves first made headlines in December 2017 when a woman climbed atop a utility box in Tehran's Revolution Street, waving her hijab on a stick. More than three dozen protesters have been detained since, including nine who are currently in detention, said Masih Alinejad, an Iranian activist who now lives in New York.

Despite attempts to silence protesters, public debate has intensified, amplified by social media.

Last month, a widely watched online video showed a security agent grab an unveiled teenage girl and violently push her into the back of a police car, prompting widespread criticism.

President Hassan Rouhani and Iran's supreme leader, Ayatollah Ali Khamenei, have supported a softer attitude toward women who don't comply with the official dress code. However, hard-liners opposed to such easing have become more influential as the nuclear deal is faltering.

They have called for harsh punishment, even lashes, arguing that allowing women to show their hair leads to moral decay and the disintegration of families. The judiciary recently urged Iranians to inform on women without hijabs by sending photos and videos to designated social media accounts.

"The more women dress in an openly sexual way, the less we'll have social peace, while facing a higher crime rate," Minoo Aslani, head of the women's branch of the paramilitary Basij group, told a rally last week.

Another gathering was attended by several thousand women in chadors. One held up a sign reading, "The voluntary hijab is a plot by the enemy."

Reformist lawmaker Parvaneh Salahshouri said coercion does not work. "What we see is that the morality police have been a failure," said Ms. Salahshouri, who wears a headscarf out of religious belief.

Changing hijab rules through legislation is unlikely because of the constraints on parliament, she said.

Instead, women should engage in non-violent civil disobedience, Ms. Salahshouri said. She cautioned that it's a slow, difficult road, but that "Iranian women have not given up their efforts."

The hijab controversy goes back to the mid-1930s when police forced women to take off their hijabs, part of a Westernization policy by then-Shah Reza Pahlavi. Under his son and successor, women could choose. Western apparel was common among the elite.

A 2018 survey by a parliament research center indicates that most women wear a casual hijab and only 13% opt for a chador.

Attitudes have changed. In 1980, two-thirds believed women should wear hijabs. Today, fewer than 45% approve of government intervention in the issue, the research said.

Iran has seen waves of anti-government protests, including an outcry after a 2009 election many contended was stolen by hard-liners. Those with economic grievances frequently protest.

Ms. Alinejad, the activist, argued the campaign against forced hijabs carries symbolic weight, saying that mandatory headscarves were "the symbol that the Iranian government used to take the whole society hostage."

In recent years, she has posted videos and photos of activists, including of women filming themselves as they walk in the streets without a headscarf. Ms. Alinejad said she receives more than 20 images a day, but posts only some.

The activists in Iran take risks.

In March, human rights lawyer Nasrin Sotoudeh, who has represented female protesters, was sentenced to 38.5 years in prison, of which she must serve 12, according to her husband.

In April, activists Yasaman Aryani, her mother Monireh Arabshahi, and Mojgan Keshavarz were arrested after posting a video showing them without headscarves in the Tehran metro. In the video, they distributed flowers to female passengers and spoke of a day when women have the freedom to choose.

Amnesty International said Monday that Iranian authorities have used incommunicado detentions, prolonged solitary confinement, and threats against family members to coerce detained activists to retract their opposition to forced veiling in video-taped "confessions." The group said it had detected such a pattern in six cases since April.

Some activists maneuver carefully.

The 30-year-old fire-safety consultant said she tries to avoid policemen when she walks the streets without a hijab. She said she grudgingly complies with the dress code when she delivers lectures or sings in a mixed choir – activities she would otherwise be barred from.

At the high-end Palladium Mall in northern Tehran, several shoppers casually ignored a sign reminding customers that the hijab is mandatory. One woman only pulled up her scarf, which was draped around her shoulders, when she stepped into an elevator and found herself next to a security guard.

Nearby, 20-year-old Paniz Masoumi sat on the stone steps of a plaza. She had dyed some of her hair blue, but kept that funky patch hidden under a loose scarf.

She said police recently impounded her car for two weeks, fining her amid claims that a traffic camera snapped her with a below-standard hijab.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

If hijabs were voluntary, she'd throw off hers, Ms. Masoumi said. But for now, "I am not looking for trouble."

This story was reported by The Associated Press.