JUNEAU, Alaska (AP) — A state court judge ruled Friday that Alaska elections officials do not need to put the fifth-place finisher in this month’s U.S. House special primary on the upcoming special election ballot in place of a candidate who withdrew.

Superior Court Judge William Morse agreed with the Alaska Division of Elections’ reading of the law, after previously saying he was tentatively inclined to rule that way. His decision can be appealed to the Alaska Supreme Court.

The division’s director, Gail Fenumiai, had said that because independent Al Gross withdrew less than 64 days before the election, state law did not permit the division to put the fifth-place candidate, Republican Tara Sweeney, on the special election ballot in his place.

A lawsuit filed by three registered voters Thursday said the division misinterpreted the law. The lawsuit argued the timeline the division cited did not apply to special elections.

Gross abruptly withdrew his candidacy, with little explanation, earlier this week.

He was third in the June 11 special primary – behind Republicans Sarah Palin and Nick Begich and ahead of Democrat Mary Peltola – and poised to advance to the special election as one of the top four vote-getters under a new open primary system.

Fenumiai said that Gross withdrew on Tuesday and his name would not be on the special election ballot. That would mean the special election ballot would include the top three special primary finishers and a space for voters to rank a write-in candidate, she said.

The special primary was the first election held under a system approved by Alaska voters that ends party primaries and institutes ranked-choice voting in general elections.

While the division is “sympathetic to the public expectation” that under the new law four candidates would advance, “it lacks the discretion to relax an unambiguous statutory deadline to effectuate this goal,” attorneys for the Department of Law, representing the division, said in court filings.

Sweeney’s campaign did not sue over the issue, but Sweeney argued that she should be moved into fourth place and that voters should have four candidates to choose from.

The lawsuit was filed on behalf of registered voters Sunny Guerin, Vera Lincoln and Elizabeth Asisaun Toovak.

Fenumiai has said that a final court decision is needed by Tuesday to print ballots in time to meet deadlines and to keep the special election on schedule.

The Department of Law, in a statement, said the division appreciated the court’s speed in issuing a ruling. “If the Plaintiffs appeal, we will be ready to very quickly defend the ruling before the Alaska Supreme Court so that ballots can be printed on schedule,” the statement says.