Employers will be able to ban Muslim staff from wearing headscarves at work, the European Court of Justice has ruled.
The court said that companies were able to ban "the visible wearing of any political, philosophical or religious sign".
The ruling made clear that if the ban was only applied to Muslim members of staff it could still constitute discrimination.
Companies would need to already have a policy in place prohibiting the wearing of religious symbols and would not be able to ban staff from wearing headscarves on the "wishes of a customer".
The judgment was sparked by the cases of two women - one living in France and one in Belgium - who were dismissed from work after refusing to remove their headscarves.
Samira Achbita, a receptionist for security company G4S, was dismissed after insisting on wearing her Islamic headscarf to work.
The company told her there was an unwritten rule prohibiting employees from wearing visible signs of religion in the workplace.
Ms Achbita challenged the decision in the Belgian courts, claiming she was being discriminated against on grounds of her religion.
In the second case, design engineer Asma Bougnaoui was fired from consultancy company Micropole, after a customer complained about her wearing of the Islamic headscarf.
Ms Bougnaoui - who had refused to stop wearing her veil - had taken her case to the Court of Cassation in France.
The Open Society Justice Initiative, a group which had supported the women, said it was disappointed by the ruling which it said "weakens the guarantee of equality that is at the heart of the EU's anti-discrimination directive."
Nick Elwell-Sutton, employment partner at law firm Clyde & Co, said: "The judgment demonstrates to employers how critical it is for a businesses to have a well-documented policy and to apply it consistently across the workforce."
In 2013, British Airways employee won a landmark legal battle over her right to wear a cross at work.
The European Court of Human Rights (ECHR) ruled that Nadia Eweida, a Coptic Christian, had been discriminated against under freedom of religion laws.
Three other Christian claimants, who launched similar action, lost their cases.
In France - a secular country that insists on the separation of church and state - school staff and those delivering a public service are banned from wearing clothes or emblems displaying a "religious allegiance".
But last year, France's highest administrative court overturned a controversial burkini ban , forbidding Muslim women from wearing full-body swimsuits on beaches.
France is currently preparing to vote for its next president, with far-right candidate Marine Le Pen, leader of anti-immigrant party Front National, riding high in opinion polls.