A federal judge in Alaska on Sunday threw out the Justice Department's lawsuit seeking to block certification of the state's U.S. Senate race if Republican Sen. Dan Sullivan loses on Tuesday.

U.S. District Judge Sharon Gleason ruled in a 20-page order that the government lacked standing to sue, CBS News reported. The department, she wrote, had failed to show that a court order could remedy the injury it alleged.

The case turned on a name. A retired teacher named Daniel J. Sullivan is also on the ballot, and the Justice Department argued his candidacy could mislead people who meant to vote for the senator. It asked the court to hold off certification so ballots cast for the other Sullivan could be investigated.

Gleason found that plan unworkable. According to NPR, she concluded such an order would likely violate Alaskans' right to a secret ballot. There was no way to sort out what voters intended without learning how they voted, Axios reported.

NPR described the suit as highly unusual. It was filed less than two weeks before Election Day, while early voting was underway, and rested on the preamble of the National Voter Registration Act.

Within hours, the department filed notice that it would take the case to the 9th U.S. Circuit Court of Appeals, CNBC reported. A spokesperson said in a statement that "Alaskan voters deserve a fair election."

Democrat Mary Peltola, who is challenging Sullivan, welcomed the ruling. Her campaign accused the administration of using the Justice Department against her.

The lawsuit is not the department's only move in the race. Prosecutors are also running a criminal investigation into an alleged effort to recruit Daniel J. Sullivan as a candidate. The Associated Press reported that a new batch of grand jury subpoenas went out Thursday. Several Democratic officials believed to be connected to the effort are among those targeted, according to CBS News.

The Sullivan-Peltola race could help decide which party controls the Senate.