JUNEAU, Alaska (AP) — A state court judge in Alaska on Tuesday sided with Democrats seeking to allow independent candidates to run in their party primaries.

In a written decision Tuesday, Superior Court Judge Philip Pallenberg said by not allowing unaffiliated candidates to participate in Democratic primaries, the state is restricting the party's attempt to appeal to independent voters.

The decision comes in a case brought against the state by the Alaska Democratic Party — and, if it stands, it could have implications for next year's elections.

The party challenged a state law requiring primary election candidates to be registered members of the party whose nomination they're seeking.

Democrats asked that the law be considered unconstitutional to the extent that it restricts candidate participation to registered members when political party rules allow for non-member candidates.

Politically unaffiliated voters — those labeled as "undeclared" or "nonpartisan" — comprise the largest voting bloc in the state. Anyone, regardless of party affiliation, can vote in the Democratic primary.

Pallenberg wrote that, by limiting the party primary to registered Democrats, the state interferes with the Democrats' chosen strategy to broaden its support in the general election.

The decision could be appealed. State Department of Law spokeswoman Cori Mills said by email that the state is reviewing the decision.

Jay Parmley, executive director of the Alaska Democratic Party, said the decision could have a long-term, positive impact on the party. "This was always done with the long game in mind," he said of the party's challenge.

A prior challenge to the law by Democrats was tossed as premature last year because it was brought before the Democrats formally adopted a party rule seeking to allow politically unaffiliated candidates to run in its primaries.

This case looms over a coming election year set to feature the governor's race and legislative seats.

Gov. Bill Walker and Lt. Gov. Byron Mallott won the support of Democratic Party leaders in 2014 in banding together to upset Republican incumbent Gov. Sean Parnell.

In teaming up, Walker changed his party affiliation from Republican to undeclared and Mallott, a Democrat who had won his party's nomination for governor, put aside that ambition to be Walker's running mate. Mallott remained a Democrat.

Walker and Mallott in August announced plans for re-election. Walker said at that time they planned make an independent run and collect signatures necessary to qualify for next year's ballot.

When asked if they would consider running in the Democratic party if allowed, Walker in August said things sometimes change during an election process and "we typically don't say never to anything, quite honestly."

"But this is the path that we have chosen" and having a bipartisan administration has served Alaska well, he said at that time.

Walker campaign spokeswoman, Lindsay Hobson, said Tuesday that Walker and Mallott did not have a comment on the court decision.

Walker and Mallott have an ongoing duty to uphold the state's laws, Hobson said. "Since this is a pending legal matter to which the State is a party, the candidates cannot comment at this time," she said in a text.

State Republican Party Chairman Tuckerman Babcock said he was delighted that Pallenberg ruled "in favor of freedom and freedom of association."

Republicans and Democrats should be allowed to decide who can run in and vote in their respective primaries, Babcock said. He plans to ask his party's rules committee to look at the state GOP's rules and "how we might address additional opportunities," he said.