A North Carolina law that cancels primaries this year for judicial seats has been partially halted.

A federal judge on Wednesday issued a preliminary injunction directing state election officials to hold primaries for appellate court judgeships in May. But U.S. District Judge Catherine Eagles refused to restore primary elections for local trial court seats.

Democrats sued to overturn the law and asked Eagles to step in, with candidate filing for other races starting Feb. 12.

Eagles agreed with Republican lawmakers who argued primaries were canceled as they debate changes to District Court and Superior Court election boundaries. But Eagles wrote that doesn’t apply to appellate court races, where candidates run statewide. She said holding free-for-all general elections for appellate seats could attract lots of candidates and confuse voters.