The decision taken by a French hospital to fire a trainee doctor due to his beard has been supported by a Parisian court ruling, French media reported this weekend.

The Egyptian national was fired from the Saint-Denis hospital center during a work placement in February of 2014 after refusing to trim his beard, Connexion France reports. Identified only as Mohammed A. court documents, the man never showed any sign of practicing Islam during his work.

In France, government employees – in schools, hospitals, and official offices – are legally barred from wearing religious symbols or maintaining religiously motivated styles in their physical appearance. However, Mohammed A. reportedly never openly identified as Muslim, he simply had a beard.

"This is a totally subjective interpretation of the so-called ‘religious’ nature of the beard. [This decision] was based on my client’s refusal [to cut his beard] because [his religion] is a private issue. The hospital would have forced him to say, ‘No, this is not religious’." the man's lawyer, Nawel Gafsia, said. 

"He is called ‘Mohammed’. If he was called ‘Lionel Dupont’, he could have had an even longer beard and there would have been no problem."

Gafsia called the decision "scandalous", "mind-boggling", "discriminatory" and "racist", adding that her client was perceived to be wearing a religious beard simply because of his nationality.

Mohammed A.'s lawyer further pointed out that a beard should not immediately denote a religious affiliation in someone's mind.

"My client could have been a hipster," Gafsia said, according to RT.

Despite Gafsia's defense, the Versailles administrative court of appeal upheld the decision of the hospital.

Fortunately, Mohammed A. was able to transfer his traineeship to Paul Brousse hospital, successfully completing the program. The management at that hospital also did not take issue with his beard, demonstrating the highly subjective nature of the previous hospital's decision.

"It was the personal judgment of the Director of Saint-Louis Hospital that posed a problem," Gafsia said, also saying that her client would take the case to France’s highest administrative court, the Council of State.

The high court has previously sided against Islamophobic moves in France. In 2016, the court overturned controversial burkini bans that approximately 30 beaches had imposed throughout the country, according to The Telegraph.

The ruling said that the bans constituted, "a serious and illegal violation of fundamental freedoms."