SALT LAKE CITY — A federal appeals court Tuesday upheld Utah's controversial election law that allows candidates to gather voter signatures in order to get on the primary election ballot.

But the battle over how political parties in the state nominate candidates for public office appears far from over.

The 10th Circuit Court of Appeals in a 2-1 decision found that the law, known as SB54, "strikes an appropriate balance" between protecting the interests of the state in managing elections and allowing the Utah Republican Party and individuals to express their preferences in a democratic fashion and to form associations as protected by the First Amendment.

"Not only does this balance not offend our Constitution, it is at its very essence," according to a three-judge panel.

The court also concluded in the 95-page opinion that states must have flexibility to enact reasonable, commonsense regulations designed to provide order and legitimacy to the electoral process.

The ruling comes as political parties in Utah held caucus meetings Tuesday night to elect delegates and cast votes for candidates to run in primary and general elections.

Utah Republican Party Chairman Rob Anderson said the GOP State Central Committee will decide the next move, but he will recommend the party accept the court's decision and the current law.

"We've had several appeals now. It's divided the party. I think we should move forward with the party business of getting people elected," he said.

"There's still a lot of uncertainty," Anderson said. "But my thought is, in the middle of an election cycle, starting with caucuses, going to convention and then the primary, let's focus on getting people elected."

The Utah GOP sued the state over SB54, which allows candidates to bypass Utah's traditional caucus and convention system by gathering signatures to get on the primary election ballot. A federal judge upheld the law but the party appealed.

The law came about as a compromise in 2014 between lawmakers and backers of the Count My Vote ballot initiative to abolish the convention nomination process in favor of a direct primary election.

Some GOP legislators unhappy with the compromise have tried to repeal SB54, which has caused deep divides and prolong bickering in the party.

The party has racked up at least $334,000 in legal bills fighting the law, which hurt fundraising and contributed to a hefty debt that Anderson has worked to erase.

Anderson announced last November that he was dropping the lawsuit, angering some GOP faithful who want to get rid of signature gathering, including Entrata CEO Dave Bateman. He agreed to pay for the legal costs going forward.

"If it has to go to the Supreme Court, I will pay every penny of that, if I have to," Bateman said last fall.

Don Guymon, a member of the party's Constitutional Defense Committee, said he's disappointed with Tuesday's ruling. He said it comes down to whether the party has a right to choose its own nominees.

There are several avenues available to the GOP to challenge the ruling, including requesting an "en banc" hearing by the entire 10th Circuit or petitioning the U.S. Supreme Court.

"After a thorough review we will decide our next course of action," Guymon said.

Some members of the committee believe the dissenting opinion provides "great grounds" for further arguments, he said.

But that could cost millions of dollars and drag out the bitter battle even longer.

"I would say it's rare for 10th Circuit to grant an en banc hearing and even more rare for the Supreme Court to accept this type of appeal," said Sen. Todd Weiler, R-Woods Cross.

Weiler, an attorney, estimated it would cost at least $500,000 to petition the high court and as much as $2 million to argue the case if it were accepted. He said he expected the 10th Circuit to affirm the lower court's decision but was surprised that one judge dissented.

Still, "this decision to me reads very final," he said.

Chief Judge Timothy M. Tymkovich concurred in part and dissented in part with the 10th Circuit opinion, writing that SB54 attempts to change the substance of the Utah Republican Party under the guise of the state’s authority to regulate electoral procedure.

"The background of this case should caution us as to the perils of allowing states to impose procedural changes of this magnitude on unwilling political parties," he wrote.

Tymkovich said it might be wise for the party to change its nomination process, and maybe it will. "But such change is not for legislatures to impose," he wrote.

A faction of the Utah Republican Party State Central Committee passed a bylaw in late February to expel candidates in the 1st and 2nd congressional districts who gather signatures. Anderson has disregarded the change, saying the party can't pass rules that violate state law.

The conflict could lead to a new lawsuit aimed at overturning SB54.

Dueling ballot initiatives also will keep the fight alive. Count My Vote aims to preserve the current dual-track nomination system, while Keep My Voice would scrap signature gathering but retain the caucus/convention process.

The Utah Democratic Party was pleased to see the 10th Circuit uphold the previous court decision, said Alex Cragun, executive director. He said it was evaluating the impact of the Utah Republican Party's "continued flaunting of SB54 in the face of so many opinions upholding the constitutionality of the law."