Paris — The European Court of Justice issued a non-binding ruling on Tuesday that employers can prohibit the Muslim headscarf in the workplace, setting an important precedent for a continent in the midst of a fraught political climate.

As a 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 the long-simmering culture wars across the continent and especially in France.

The court addressed different complaints from two Muslim women — one from France and one from Belgium — who alleged that their respective 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 particular disputes in question.

The Netherlands will vote on Wednesday in parliamentary elections in which the far-right populist Geert Wilders has already succeeded in bringing his openly anti-Muslim views into the center of public discourse.

In France, still reeling from a slew of 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 similarly 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 are 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.

In a strongly secular Europe home to a growing Muslim minority — especially sizable in France and Belgium — the cases present the oft-contradictory natures of two distinct liberties: the freedom of religion and the freedom of enterprise.

The tension between the two is particularly high in a France on the eve of a historic presidential election in which much of the debate has focused on issues of identity and culture. The place of Islam in French society has become a fixation across the political spectrum.