JUNEAU (AP) — Alaska voters have narrowly approved a ballot measure that would end party primaries and institute ranked choice voting in general elections.

Alaska stands to join Maine, which for the first time this year used ranked choice voting in a general election for president and began using it for congressional races in 2018.

Utah and Virginia have passed legislation authorizing ranked choice voting in local elections, and a small number of U.S. cities use ranked choice voting, according to the National Conference of State Legislatures. A similar ballot measure in Massachusetts failed this month.

The outcome of the Alaska initiative was close and not called until Tuesday as state election officials worked toward completing their counts of absentee and other ballots. The state has targeted certification of election results for Nov. 25.

The ballot group Yes on 2 for Better Elections characterized the initiative, in part, as a way to loosen party control over the primary process and give voters greater choices. The largest bloc of registered voters in Alaska are listed as nonpartisan or undeclared and commonly referred to as independents.

The opposition group Defend Alaska Elections - Vote No on 2 said the initiative would destroy "any meaningful role for political parties" and dismissed ranked choice voting as "political trickery."

"Sometimes we need to choose better leaders - but we don't need to monkey around with the way we vote for them," the group said on its website.

Messages seeking comment were left for Brett Huber, the opposition group's campaign manager.

Scott Kendall, a drafter of the initiative and an attorney for the initiative sponsors, called the results of the election gratifying. He said he doesn't see this as an experiment but as moving toward a system that "reflects our political diversity."

Debate over the initiative cut across party lines, and Kendall said backers had to pull from every category of voters. He said he thinks voters, as they get used to the changes, will like them.

He said it's possible there could be legal challenges. Kendall said the Legislature could make changes, though none that would undermine the purpose, and cannot repeal a law passed by initiative for two years from its effective date.

Under the initiative, primary candidates would appear on one ballot, with the top four vote getters advancing to the general election. Voters in the general election would rank their choices. The changes would apply to state legislative, gubernatorial and congressional races.

Ranked choice voting in the general election would apply to a presidential race, though Kendall said the primary piece would not as the parties have their own separate processes for nominating presidential candidates.

The initiative also would impose additional disclosure requirements for independent expenditure groups.