BRUSSELS (Reuters) - Asking a Muslim employee to remove her headscarf when dealing with clients amounts to unlawful direct discrimination, a legal advisor to the European Union's top court said in a written opinion on Wednesday.

The case arose when a female employee of a French IT consultancy was fired after refusing to remove her headscarf when meeting clients. She challenged this before a French court, which referred the case to the European Court of Justice.

"There is nothing to suggest she was unable to perform her duties as a design engineer because she wore an Islamic headscarf," Advocate General Eleanor Sharpston wrote.

Opinions by the Court's advocates general are advisory but it usually follows their advice in drawing up a final ruling.

While a company could impose a neutral dress code if it pursued a legitimate aim, Sharpston said it was hard to see how such a measure could be seen as proportionate in the present case.

France bars civil servants from wearing clothing indicating religious belief, such as a headscarf or a Jewish skullcap, but not employees in the private sector. Companies can set dress codes but their exact legal status is disputed.