In a split decision, the Supreme Court of Canada has ruled that a woman can wear a religious veil across her face while testifying in court -- but only in certain circumstances.

The justices were not able to make a definitive ruling, which pits religious freedom against a defendant’s right to a fair trial. Instead, the top court produced a rare 4-2-1 split decision.

The case involved a Toronto woman -- identified only as "N.S." -- who accused her cousin and uncle of repeatedly sexually assaulting her over a four-year period when she was a child. She wanted to testify against them in court, but also wanted the right to wear her religious veil while doing do.

N.S. wears a niqab -- a veil that covers her face so that only the eyes can be seen through a slit. She said her Muslim faith dictates that she wear the veil in public and that she wouldn’t testify without it.

The two defendants, meanwhile, claimed the Charter of Rights allows them to confront their accuser and observe her facial expressions. They said they needed to see the accused's face so they could assess her demeanour, which they said was key to defending themselves.

Writing for the majority, Chief Justice Beverley McLachlin said the decision on whether to allow the face-covering must be made on a case-by-case basis and that judges would have to consider four questions before deciding whether to order a witness to remove her veil.

One of those questions would be whether permitting the witness to wear the niqab while testifying would create a serious risk to trial fairness. They would also have to consider whether there was a way to accommodate both the rights of the witness and the rights of the accused to see their accuser, to avoid a conflict.

If there weren’t, McLachlin said, a trial judge would be allowed to order a witness to remove his or her veil.

The Supreme Court said that in cases where the liberty of the accused is at stake, “the witness's evidence is central to the case and her credibility vital, the possibility of a wrongful conviction must weigh heavily in the balance, favouring removal of the niqab."

That decision leaves it open to a judge to allow witnesses whose credibility is not central to the case to continue to wear their veils.

The decision means the N.S. case will have to go back to the Ontario trial judge who started hearing the preliminary trial and who first ordered N.S. to remove her veil.

But two other justices, Marshall Rothstein and Louis LeBel, disagreed with McLachlin’s take on the case. They said that the principle of openness of the trial process requires that niqabs never be worn on the witness stand.

Justice Rosalie Abella, meanwhile, dissented completely, saying forcing a witness to remove her niqab is “a significantly more harmful consequence than the accused not being able to see a witness’s whole face.”

She said such a requirement would likely result in witnesses refusing to testify or bring charges in the first place. It could also mean that she would be unable to testify in her own defence if she were the accused.

“Unless the witness’s face is directly relevant to the case, such as where her identity is in issue, she should not be required to remove her niqab,” Abella wrote.

David Butt, the lawyer who represented N.S. said his client is “thrilled with the fairness, and the balance the Supreme Court has shown.”