When the social media storm continued to rage, Borusan took out full page ads in several nationally distributed newspapers to apologize.

“We are extremely sorry to have been misunderstood,” the ad said.

Next, Borusan’s chief executive, Agah Ugur, held a news conference on Jan. 2 and announced that Mr. Bayulgen had resigned. Mr. Ugur added that the company offered its “deepest apologies to all our compatriots, whatever language, religion, race, creed, attire or lifestyle they may have.”

Head-scarved women were delighted.

“For so long, we have been discriminated against with impunity,” said Neslihan Akbulut, president of the Women’s Rights Association Against Discrimination, or Akder, a nongovernmental organization campaigning for the rights of covered women. “Now,” she said by telephone this week, “discrimination has for once been punished.”

Although two in three Turkish women wear head scarves, according to several surveys taken over the past decade, the covering is officially banned from the public sphere, the definition of which is continually contested. Looked down on by the urban ruling class as the garment of poor women, it was long considered unfit for educated society.

Ms. Akbulut attributes the shift in public attitude evidenced in the Borusan flap in part to the growing purchasing power of the new Anatolian middle class, whose rapid economic upward mobility has brought traditional social values to bigger cities like Istanbul, Ankara and Izmir.

While the sight of a head scarf in an upscale Istanbul shopping mall would have raised eyebrows a decade ago, women in designer scarves now dominate crowds in some of the glitziest malls of the city, and even the sight of a woman in silk head covering and sunglasses at the wheel of a luxury sport-utility vehicle has become commonplace in Istanbul and elsewhere.

“They are an economic force,” Ms. Akbulut said.

But the main cause of the shift is the political climate under the government of the Justice and Development Party, which shares the socially conservative and religious values of many of the women who wear head scarves, Ms. Akbulut said.