VISOKO, Bosnia and Herzegovina — For years, Bosnian Muslims embraced a form of religion so moderate that many capped dinners during the holy month of Ramadan with an alcoholic drink.

But the bloody war that pitted Muslims here against their Serbian Orthodox and Croatian Catholic neighbors tested the faith of one of the few European countries where Islam is the most common religion. It was once rare to see public expressions of faith on the street. Now, more women are donning head scarves — and one who does so just became mayor of this small town in the mountains of central Bosnia.

Amra Babic’s election victory in Visoko late last year made her the first mayor in this war-scarred Balkan country, and perhaps all of Europe, to wear the hijab. Her rise in this river valley town of 46,000 is making inroads for others who have also taken up visible signs of their religion. And it is challenging assumptions across Europe as societies debate whether to reject as repressive the Islamic practice of women covering themselves or to embrace it in the spirit of moderation.

France banned the niqab, or full-face covering, two years ago. Turkey, which has long put up barriers to observant women in public life, recently eased restrictions on wearing the hijab in public universities. Other countries are debating their policies.

In Bosnia, an inland, rolling country of 3.8 million, Islam was introduced in 1463 by the Ottoman Sultan Mehmed the Conqueror. The hijab has long been a part of the country’s life, especially in rural areas such as Visoko, but it dropped away during more than 40 years of communism. Practicing religion openly in the officially atheist state meant jeopardizing opportunities and jobs.

Many women cite their wartime experiences in their decisions to return to the moderate form of Islam that has defined religious practice for centuries. Some say they felt that Europe and the United States were slow to come to their aid during the war because of concerns over Islamic terrorism, and that their only recourse was God.

The war drew jihadists from the Middle East, and there are still pockets of violent religious extremism here. But many Bosnian Muslims say that the resurgence of moderate religious practice is a counterbalance to the ultraconservative forms practiced at the periphery.

Babic, a trained economist, is quickly making waves in her country for her political acumen. In the short time since she took over the town hall in the middle of November, she has earned a reputation as a tough administrator. Even jaded observers of Bosnia’s deeply divided political system hold out hope that she could help overcome years of government turmoil that have put the country far behind its rivals, Serbia and Croatia, which are both on a path to joining the European Union.

“I am European, I am Muslim. This is my identity,” she said. The hijab “is what you see on the outside. But the strength is what’s inside, not to do bad deeds. To live my life in honesty, and not to speak the language of hate.”

Hijab creates barriers

Here in Visoko, the winter air is filled with the pungent, sour smell of fabric chemicals from the processing plant that is the main source of scarce jobs. Unemployment in Bosnia is about 50 percent, distrust among ethnic groups remains high and official corruption is rampant. In Babic’s first week on the job, the town hall’s electricity was almost cut off because there hadn’t been money to pay the bill.

“Ordinary people don’t need much,” said Babic, who raised three sons alone after her husband was killed three weeks before she gave birth to the youngest. “They just need to feel that someone is looking after them.”

But barriers still exist to women who cover their heads. Many people who wear the hijab say they experience job discrimination. In public life, women in the army have complained of being harassed if they cover their heads, and there was a heated public argument several years ago about whether hijabi women should be allowed to serve in the judiciary. Several now do.

Part of Bosnia’s Islamic revival has been encouraged by Saudi and Turkish funds that financed the reconstruction of the country after the war destroyed some of its most famous religious monuments, along with much of its infrastructure. In Sarajevo, the soaring King Fahd Mosque, the largest in the country, was built in 2000 with Saudi support, and weekend prayers draw crowds of conservative faithful.

Extremist enclaves at Bosnia’s fringes have caused problems within the country, including an October 2011 shooting attack on the U.S. Embassy in Sarajevo by a Serbian Muslim that wounded a local police officer. But the number of people linked to the extremist community is small, officials say, and not growing.

Changing attitudes

In the urban streets of Sarajevo, Bosnia and Herzegovina’s capital, where copper-domed Ottoman-era mosques have pierced the skyline with their minarets for centuries, hijabs have become more visible since the war, though they remain uncommon. More women wear them in rural areas such as Visoko. Full face veils are rare.

“During communism, you didn’t have educated women wearing the head scarf rising to positions of prominence,” said Djermana Seta, the head of the research at the NAHLA Center for Education and Research. Even now, Seta said, “the main sentiment is, ‘This is an uneducated, rural woman.’”

For that reason, many Bosnian Muslims hope that Babic’s election might help change attitudes about the hijab.

“People think that if you are covered, you’re stupid,” said Senada Spahovic, 46, who works as a cook at an Islamic boarding school just outside of Visoko and was wearing a silver-colored embroidered hijab one recent day.

“This is my shield on my head,” Spahovic said of her scarf. She started wearing it in 1995, after her husband was killed in Gorazde, her home town, which was besieged during the war.

One girl at the boarding school where Spahovic works said that Babic was a role model.

“She means something new here, not just for Bosnia but for Europe too,” said Sumejja Essidiri, 19, who was in a study hall of tittering girls, all wearing hijabs. “When we cover our heads we say, ‘Okay, I’m a Muslim and I’m open,’” she said.

Even many women who do not cover their heads have an increasingly laissez-faire approach to the topic.

“We are proud that she was elected,” said Jasmina Ismic, 60, a Visoko native with a stylish brown bob who, striking a pose, bragged that she had been Miss Yugoslavia in 1970. She also said that she ran into Babic at the mosque. “I have my style, she has hers,” she said.