Two controversial B.C. religious leaders who were set to challenge Canada's laws against polygamy won't soon get the chance now that a judge has quashed the charges against them.

Winston Blackmore and James Oler were arrested earlier this year in Bountiful, B.C., and charged with one count each of polygamy.

The men had petitioned the court to stay the charges, arguing that the B.C. attorney general had gone "special prosecutor shopping" until he found someone who would go ahead with charges.

In a decision released Wednesday, B.C. Supreme Court Judge Sunni Stromberg-Stein agreed.

The judge said the province's attorney general did not have the jurisdiction to appoint a second special prosecutor to consider charges against Blackmore and Oler after the first special prosecutor recommended against charging the two men.

B.C. Premier Gordon Campbell said Wednesday he found the court ruling disappointing, but will not give up on the government's goal of resolving the issue of polygamy in British Columbia.

Campbell said the government will review the court ruling and may appeal.

"I was surprised and disappointed when I heard the ruling," he said. "The attorney general is going to review it and we'll see what our next step should be."

Campbell said the government remains concerned about tackling polygamy in British Columbia.

"It's important to solve the issue, yes," he said. "The question is how do you solve it."

B.C. Attorney General Mike de Jong said the ministry may consider an appeal.

"It's not the result that obviously we were hoping for or looking for, and it's obviously an impediment towards advancing this prosecution," he said.

De Jong said he supported the earlier decision by his predecessor, Wally Oppal, to take the polygamy cases against Oler and Blackmore to court.

Stromberg-Stein said she found that the appointment of the second special prosecutor -- and therefore the decision to charge the men -- was "unlawful."

The attorney general had no jurisdiction to appoint a second special prosecutor after the first one recommended against charges, the judge concluded.

Blackmore and Oler are leaders of two separate factions of the Fundamentalist Church of Jesus Christ of Latter Day Saints, a breakaway sect of the mainstream Mormon Church, which renounced polygamy more than a century ago. Blackmore was accused of having 19 wives, and Oler three.

The RCMP have launched numerous investigations into Bountiful since 1990, but prosecutors have repeatedly shied away from laying charges, concerned the polygamy laws wouldn't survive a challenge under the Charter of Rights and Freedoms.

The Mounties launched a renewed investigation in 2005 and two years later recommended charges against Blackmore and Oler.

Several legal experts consulted by the province, including a special prosecutor appointed two years ago, suggested the issue should be referred to the Supreme Court of Canada to determine the constitutionality of the law before any charges were laid.

But then-attorney general Oppal appointed another special prosecutor, Terry Robertson, last year, and Robertson ultimately recommended charges.

Bruce Elwood, who represented Blackmore and Oler at the hearing, said the judge quashed the appointment of the special prosecutor, which quashes the charges.

It's not the same as throwing out the charges, he said, but he added he's not sure how the charges could be resurrected.

"I believe this will be the end of the criminal case but what the judge has actually done is to quash the appointment of the special prosecutor," he said.

The B.C. Criminal Justice Branch will have to decide what they will do now, he said.