TORONTO - A court ruling that sets a high threshold for demanding a woman remove her niqab while giving testimony was hailed as a victory Wednesday by advocates on both sides of the thorny debate.

Witnesses who wear the face-covering veil must remove it on the stand, but only if wearing it truly jeopardizes the accused's right to a fair trial, the Ontario Court of Appeal ruled.

The issue of a women's constitutional right to express her religious beliefs in court, and the right of the accused to face their accuser, must be decided on a case-by-case basis, the court added.

The decision effectively means women will only be forced to testify without the niqab in extreme cases, said Nathalie Des Rosiers, general counsel for Canadian Civil Liberties Association.

"The circumstances are likely to be rare," said Des Rosiers, whose organization was a respondent in the case.

"It will require the defence to establish, on narrow grounds, how removing the niqab is indeed necessary to establish a particular point."

The case centres around a woman identified only as N.S., who has accused her cousin and uncle of repeatedly sexually abusing her as a child.

At the preliminary inquiry the judge ordered N.S. to remove her veil to testify, but the ruling ended up in the Appeal Court.

The Muslim Canadian Congress, which argued that N.S. should testify without her veil, welcomed Wednesday's decision, saying it "denies the automatic right of a woman to wear a face mask in court by invoking her right to religious freedom."

Still, the group said it had hoped for stronger language from the court.

"I think it's a bit politically correct, but it's a small step in the right direction," said congress president Sohail Raza, who called the niqab "unnecessary garb" that throws women "back into the dark ages."

"You can't hide behind the mask, especially in a case, in a court case. A jury wants to see your body language, your face."

The Appeal Court, in its decision, recognized the challenge facing judges as they encounter witnesses wearing the niqab.

"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 unanimous decision of the three-judge panel reads.

"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."

Each case, however, must "turn on its own facts" and the judge must listen to the concerns of the witness regarding her religious beliefs, the court said.

"If a witness establishes that wearing her niqab is a legitimate exercise of her religious freedoms, then the onus moves to the accused to show why the exercise of this constitutionally protected right would compromise his constitutionally protected right to make full answer and defence."

An objection to a witness wearing her niqab in a preliminary inquiry — at which there is no jury — would likely fail, the court added.

The "significant" decision affirms fair trial rights but also access to justice for Muslim women and all sexual assault complainants, said Joanna Birenbaum, the legal director of the Women's Legal Education and Action Fund, also a respondent in the case.

"The court sent a message that, No. 1, it's not just the rights of the accused to a fair trial," said Birenbaum.

"It specifically said that the rights asserted by the complainant are powerful, which is important."

The high court sent the case back to the preliminary inquiry judge, and ordered the judge to let N.S. make arguments about her religious beliefs.

"If the judge is required to determine whether N.S. can wear her niqab while testifying, he will do so in accordance with (the reasons of Wednesday's decision)."

During arguments before the Appeal Court in June a lawyer for one of the defendants said N.S. has not said she refuses to testify without her face covered, just that she would feel more comfortable wearing the niqab.