The European Court of Justice (ECJ) ruled on Tuesday that employers can ban staff from wearing visible religious symbols, including headscarves.
The ECJ ruled on the cases of two female employees in Belgium and in France, who had brought the case to trial after being dismissed for refusing to remove their headscarves.
"An internal rule of an undertaking which prohibits the visible wearing of any political, philosophical or religious sign does not constitute direct discrimination," the ECJ said in a statement.
"However, in the absence of such a rule, the willingness of an employer to take account of the wishes of a customer no longer to have the employer’s services provided by a worker wearing an Islamic headscarf cannot be considered an occupational requirement that could rule out discrimination."
The court's ruling was based on the case of a Belgian woman who worked as a receptionist for G4S Secure Solutions, a British security services company which has a general ban on wearing visible religious, philosophical or political symbols. She was dismissed after refusing to comply with the ban.
The court's ruling also covered a French IT consultant who worked for the French company Micropole. She was told to remove her headscarf after a client complained and refused to comply, which led to her dismissal.
The Islamic headscarf has long been a controversial issue in several European countries. In France, the issue has been even more contentious as the country attaches a lot of importance to the separation of state and religious institutions.
The ECJ judgment comes on the eve of the Dutch election in which Muslim immigration and integration has been a key issue and the result of the election is considered a bellwether for attitudes to migration and refugee policies across Europe.
This story is developing.