A Muslim woman fighting for the right to wear her niqab while testifying in a sexual assault case has suffered a partial setback.

A Superior Court of Justice judge said in a judgment released Friday that a judge in a preliminary hearing can order a complainant to remove the niqab, which covers the entire face except for the eyes, during testimony if the judge believes the complainant is not wearing it for religious reasons.

The ruling is the latest step in a legal battle that is believed to be the first of its kind in Canada.

Justice Frank Marrocco heard arguments in the case in March and last month.

The woman appealed a ruling from last fall. Ontario Court Justice Norris Weisman ordered her to testify with her faced bared.

He ruled the woman's religious beliefs weren't that strong and that she wore the niqab out of comfort.

Marrocco would not issue an order allowing her to wear a niqab when the preliminary hearing resumes.

He did instruct Weisman to conduct another hearing to explore the issue of why the woman is wearing a niqab.

"The failure to explore the limits and exceptions of the applicant's professed religious belief may have resulted in the preliminary inquiry judge mischaracterizing the applicant's evidence as an assertion that wearing the veil was a matter of comfort," Marrocco wrote in his 38-page ruling.

Once Weisman has carried out that hearing, he would be within his jurisdiction to make a determination on whether or not the woman can wear a niqab.

"At risk of stating the obvious, if the preliminary inquiry judge is not satisfied by the applicant that she is wearing a veil for a religious or other valid reason, he has the authority ...to order her to remove it, provided he is satisfied that he must make such an order to regulate the preliminary inquiry in a way consistent with the Criminal Code."

Lawyers for the accused want the niqab removed, while the woman's lawyers have argued allowing the court to see her eyes is sufficient to judge credibility.

The Ontario Human Rights Commission backs the right of the woman to wear a niqab.

Some liberal Muslim groups have argued that Muslim women do not have a religious obligation to wear the niqab.