A bicyclist wearing a headscarf passes an election billboard in Amsterdam. (Peter Dejong/Associated Press)

The European Court of Justice ruled Tuesday that employers can prohibit the Muslim headscarf in the workplace. Although nonbinding, the decision sets an important precedent for the continent amid a fraught political climate.

As strong anti-immigrant sentiment spreads into the political mainstream and right-wing parties soar in popularity ahead of several key elections this year, the ruling is bound to fan the flames of long-simmering culture wars in Europe, especially in France.

The court addressed complaints from two Muslim women — one from France and one from Belgium — who alleged that their employers had discriminated against them for wearing the Muslim headscarf, or hijab, to the office.

The judges concluded otherwise: “An internal rule . . . which prohibits the visible wearing of any political, philosophical or religious sign does not constitute direct discrimination.”

Courts in France and Belgium will be left to settle the disputes in question.

In France, which is still reeling from terrorist attacks in the past two years perpetrated mostly by Islamic State militants or sympathizers with French and European passports, the far-right National Front party is on the rise.

Marine Le Pen, the party’s contender for president, is almost certain to qualify for the second and final round of the vote in May.

The particulars of the two cases considered in Tuesday’s ruling were different. In the absence of official internal regulations prohibiting what employees can wear to work, the court suggested, Muslim women have a stronger case for wearing the hijab to the office.

According to the court, this was true in the French case.

The plaintiff in that case was Asma Bougnaoui, a Muslim woman who worked as an engineer at Micropole, a French IT firm. She had worn the headscarf when she was hired in 2008, but a client subsequently complained to her supervisors, insisting that there be “no veil next time.” Bougnaoui refused to take it off and was fired in June 2009.

Because there was no official policy banning the headscarf at Micropole, “the willingness of an employer to take account of the wishes of a customer no longer to have the services of that employer provided by a worker wearing an Islamic headscarf cannot be considered a genuine and determining occupational requirement,” the court said.

But the Belgian case presented a different scenario.

In that case, Samira Achbita, a Muslim woman, was hired in 2003 as a receptionist by G4S, a British multinational security company. Unlike her French counterpart, Achbita had not worn the hijab at the time of her hiring by the firm, which has a clear “neutrality” policy.

Only in 2006 did she request that she be permitted to wear the headscarf. Because of the company’s policy prohibiting “political, philosophical or religious signs” in the workplace, Achbita was dismissed.

In strongly secular Europe — home to a growing Muslim minority that is especially sizable in France and Belgium — the cases highlighted two often contradictory liberties: the freedom of religion and the freedom of enterprise.

The tension between the two is particularly high in France ahead of the presidential election, in which much of the debate has focused on identity and culture, with the place of Islam in French society becoming a fixation.

Meanwhile, the Netherlands will vote Wednesday in parliamentary elections in which the far-right populist Geert Wilders has brought his openly anti-Muslim views into the center of public discourse. And in Germany, where parliamentary elections are looming, a far-right party is poised to make considerable gains amid populist fears about immigration and Islam.

According to some estimates, France is home to the largest Muslim population in Europe, and among the most visible signs of that community is the headscarf, a source of long-standing controversy in a secular country that bans overt religious signs from public life.

Since the late 1980s, France has systematically policed what Muslim women can wear in public.

In 2004, for instance, it banned the headscarf from its public schools, and in 2010, it became the first European country to ban the burqa — the head-to-toe covering. This past summer, after a terrorist attack in the Riviera city of Nice, local authorities in the south of France attempted to ban the “burkini,” a swimsuit not unlike a diver’s wet suit designed to allow Muslim women to enjoy the beach while respecting traditional codes of modesty.

The rules for public and private enterprises differ, with private enterprises often offering employees more freedoms. Although France’s ban on religious signs and symbols in public places is technically intended to cover other religions as well — barring, for example, the wearing of crosses and the Jewish kippah, or yarmulke — critics say the prohibitions are disproportionately directed against Muslims, especially Muslim women.

“Basically, the question is now for corporate groups to decide if they will be inclusive of all religious groups, or whether they want to integrate into the current political climate, which is targeting specifically one community,” said Marwan Muhammad, president of the Collective Against Islamophobia in France, which supports Bougnaoui.

Muhammad sees the verdict against her as yet another attack on Muslim women in French and the wider European society. “Her space is always being restricted, over and over again,” he said. “There is a reality from which Muslim women are repeatedly expelled.”