Ontario judges will decide on a case-by-base basis when it is truly necessary for niqab-wearing women to remove their face-veils when testifying in court.

The Ontario Court of Appeal has ruled that judges must take into the account the religious belief of witnesses when deciding if such a drastic step is necessary.

But, in a decision released Wednesday, the Appeal Court said a person must only be compelled to remove their niqab if it truly jeopardizes an accused person's right to a fair trial.

"There is no getting around the reality that in some cases, particularly those involving trial by jury where a witness's credibility is central to the outcome, a judge will have a difficult decision to make," the court said in its ruling.

"If, in the specific circumstances, the accused's fair trial right can be honoured only by requiring the witness to remove the niqab, the niqab must be removed if the witness is to testify."

The Appeal Court released its decision after taking months to consider the case of a woman who had been ordered to remove her niqab at a preliminary inquiry.

The preliminary inquiry was part of case that concerned allegations that the woman had been sexually abused by her cousin and uncle when she was a child.

But the defendants argued that they needed to see her face when she was testifying, so they could assess her demeanour, which they say is key to defending themselves.

The judge at the preliminary inquiry said the woman had to remove her niqab, but her lawyer appealed the ruling, which was appealed to the Superior Court of Ontario and after that, the Appeal Court.

The Appeal Court has now sent the case back to the preliminary inquiry judge, with an order for the woman to have the opportunity to make arguments about her religious beliefs.

After hearing her arguments, the judge will decide whether it is necessary for the woman to remove her niqab to testify.

Her lawyer has said his client is not unwilling to testify without her niqab, just that she would feel more comfortable wearing it.

Before coming to its decision, the Appeal Court heard from lawyers representing at least seven parties who wanted to weigh in on the controversial matter of whether the woman should be able to wear her veil on the witness stand.

With files from The Canadian Press