Quebec public security officials are defending a Montreal prison that barred a newly recruited prison guard from wearing her hijab on the job.

The young woman, who was training to become a guard at Bordeaux Prison, insisted on wearing her headscarf at the institution.

Prison authorities told the woman the Muslim headscarf could threaten her safety if she were to eventually patrol among prisoners. Prison rules require guards to keep their hair tied back and abstain from wearing ties, but make no explicit mention of hijabs.

The woman chose to quit instead of removing her headscarf.

The situation is unfortunate but the prison was right to enforce the rules, said Quebec deputy security minister Jean Lortie. A hijab could quickly become a noose or other weapon if a prisoner grabbed hold, he said.

He pointed out that other Canadian security agencies have similar rules. "Even the RCMP, the federal corrections system, nobody is allowing it," Lortie told CBC.

The prison offered no alternatives, even though they exist, said Sarah Elgazzar, a spokeswoman for the Canadian Council on American-Islamic Relations. "There's really no shortage of ingenuity when it comes to hijabs. There's about a million and eight different ways to wear it. If there was a will to find a compromise, there would have been a compromise made."

Lortie said he's open to discussing compromises that could resolve the differences between prison rules and Muslim law.