CRANBROOK, B.C. -- A judge says two men found guilty of polygamy knew the practice was illegal as she rejected a constitutional challenge on the grounds of freedom of religion and expression.

Winston Blackmore and James Oler were found guilty in B.C. Supreme Court last July of having multiple wives, but a lawyer for Blackmore argued the law infringes on charter rights.

On Friday, Justice Sheri Ann Donegan dismissed all the arguments that were made to stay the charges, including a claim of abuse of process.

Both men have been leaders in the small community of Bountiful in southeastern B.C., where court heard residents are members of the Fundamentalist Church of Jesus Christ of Latter-day Saints, which condones plural marriage.

Blackmore, 62, was found guilty of marrying two dozen women, while Oler, 53, was found to have five wives. Both men face a maximum of five years in prison.

Donegan read a summary of her 95-page written decision in court, saying Blackmore knew polygamy was illegal, but continued to practice plural marriage because it is a central part of his faith.

"Mr. Blackmore's conduct, in regards to his plural marriages, has always been governed by one thing: his religious and priesthood duties," she said.

Donegan said Oler, too, knew that polygamy is illegal in Canada.

In December, Blackmore argued that he believed he was allowed to practice plural marriage because he wasn't charged when police investigated allegations about his multiple wives in the 1990s.

In 1991, the RCMP completed a 13-month investigation into Bountiful by recommending polygamy charges against Blackmore and another man, but B.C.'s attorney general decided not to lay charges because of uncertainty over whether the law was unconstitutional on the grounds of religious freedom.

Blackmore's argument relied in part on a news release from 1992 announcing that Crown counsel would not approve polygamy charges.

Donegan said in her written decision that the Crown's decision not to prosecute at that time was "made in the utmost good faith."

"It was not a declaration by the state that the polygamy law was invalid or the applicants' conduct was 'lawful.' It could not be," she said, noting that the Crown cannot suspend laws or exempt certain groups from a particular law.

Outside court, Blackmore said he doesn't encourage anyone to practice polygamy, but he also doesn't discourage anyone who has a religious commitment.

"I know one thing, and that's that our faith is as good as anybody's. But at the end of the day, we need to be people who try to respect the laws of our country," he said.

"I didn't know it was illegal. We got a definite letter from the attorney general at the time, which said that our conduct was protected under the charter -- the same charter, by the way, that affects all the same-sex couples ... the same charter that affects every other person's right to associate with whoever they choose. All I'm saying is that I should equally enjoy that same right."

His lawyer, Blaire Suffredine, argued previously in court that the unions were never legal marriages, but common-law relationships sanctioned by Blackmore's church, which carry no legal weight.

Special prosecutor Peter Wilson said Blackmore was always at risk of prosecution, even though Canada's polygamy laws have in the past been constitutionally vague.

The B.C. Supreme Court upheld the polygamy laws in the 2011 reference case, ruling that a section of the Criminal Code banning plural marriages is constitutional. The court's chief justice found that the harm against women and children outweighs concerns over protecting religious freedom.

"The release of the polygamy reference was a sea change in the legal landscape," Wilson said during legal arguments in December. "Nothing could have been more significant to a charging decision, in the circumstances of this case, than that."

Oler did not have legal representation, but a lawyer was appointed as a friend of the court to ensure he received a fair trial. Oler left court on Friday without commenting.

Blackmore said after nearly 28 years, the legal battle over polygamy has been a test of the community's faith.

"But it's kind of driven us together," he added.

Blackmore said he will not decide whether to appeal until after he is sentenced. The case returns to court on May 15 for a sentencing hearing.

Dan McLaughlin, a spokesman for the province's public prosecution service, said he believes there were some historical convictions involving polygamy from the 1890s.

"Those were in entirely different situations and likely would not assist the court in crafting an appropriate sentence in this case," he added.