Employers are entitled to ban workers from the “visible wearing of any political, philosophical or religious sign” including headscarves, Europe’s top court has ruled.

But the ban must be based on internal company rules requiring all employees to “dress neutrally”, said the European Court of Justice (ECJ).

It cannot be based on the wishes of a customer, it said.

It is the court’s first decision on the issue of Islamic headscarves at work.

The ECJ’s ruling was prompted by the case of a receptionist fired for wearing a headscarf to work at the security company G4S in Belgium.

Belgium’s court of cassation had referred the case to the EU’s top court for clarification.

The issues of Muslim dress and the integration of immigrant communities has featured prominently in debates in several European countries in recent years.

Austria and the German state of Bavaria have recently announced bans on full-face veils in public spaces.

The rights group Amnesty International said Tuesday’s ECJ rulings were “disappointing” and “opened a backdoor to… prejudice”.

The Islamic veil across Europe

What’s the difference between a hijab, niqab and burka?

The ECJ ruled on the case of Samira Achbita, fired in June 2006 when, after three years of employment, she began wearing a headscarf to work.

She claimed she was being discriminated against on the grounds of her religion.