GREENSBORO, N.C. (AP) — A North Carolina law canceling this year's judicial primaries came Wednesday before a federal judge who will decide whether the law should be implemented after hearing arguments about the right of political parties to back candidates and the General Assembly's authority to set election parameters.

The state Democratic Party and several county Democratic parties sued last month over an October law that eliminated partisan primaries for trial and appellate court judgeships for this year only. They said it violated their constitutional right to associate as a party and choose in an election people they believe best represents their party for the general elections.

Democrats asked U.S. District Judge Catherine Eagles to block the law so candidate filing could be held starting Feb. 12 with a partisan primary in May, like other 2018 elections for Congress and the legislature. Otherwise, the new law directs June candidate filing for one November election that could feature multiple candidates from multiple parties, along with other unaffiliated candidates.

"The right here is the right to select the standard-bearer for the party," Democratic Party attorney Eddie Speas told Eagles, adding that doing away with partisan primaries for partisan elections "is anti-democratic. It's contrary to our form of government."

Eagles asked questions on the preliminary injunction motion during a nearly three-hour hearing and didn't immediately rule, but recognized other candidate filing was in less than three weeks. "I appreciate time is short," she said.

Republican legislative leaders approved the unusual primary cancellation because they said they needed time to consider approving new judicial election districts for District and Superior Court seats, as well as whether to do away with head-to-head judicial elections.

Sticking to the usual election schedule could lead to confusion, they have said, especially if new districts are approved by the full General Assembly after candidate filing and a primary under old maps were held. The House and Senate assembled a judicial redistricting committee this month, but Speas said the possibility of altered districts isn't a strong enough argument to cancel the primaries.

GOP attorney Martin Warf defended the law, saying a party's right of association is still secure even if party members can't elect a nominee in a traditional primary. A party can hold a caucus or other methods to rally support around a favored candidate, Warf said, and the law doesn't prevent an individual from identifying as a party member.

A party is "free to choose ... in the general election who they want to support," said James Bernier, a special deputy attorney general representing the state and state elections board. "The state is not trying to dictate to the parties how to select their nominees."

Bernier acknowledged that if the law were carried out, there would be nothing on the general election ballot that designated which candidates received a party's formal endorsement or support. Each candidate would have their party designation by their name on the ballot.

Eagles raised concerns that during judicial filing in June a candidate could switch their voter registration moments before filing. Current law requires a party primary candidate to be a party member for at least 90 days previously. The same-day resignation change could lead to ballots filled with candidates who don't represent a party's values, Democratic Party attorney John Wallace said.

The October law is among several recent actions directed at the judiciary by the Republican-controlled legislature. Since late 2016, legislators have moved all judicial races from officially nonpartisan affairs to partisan and directed the number of Court of Appeals judges be reduced from 15 to 12.