JUNEAU, Alaska - A judge on Friday ruled against Republican Joe Miller's lawsuit challenging how Alaska counted write-in votes for rival Lisa Murkowski in their Senate race, delivering a crushing blow to the tea party-backed candidate's long-shot legal fight.

Judge William Carey's ruling all but ends Miller's hopes of getting relief in state court. Miller can appeal to the state Supreme Court, and his spokesman said he was considering the option, but Carey cited past decisions by the high court in his ruling.

The judge said his decision to throw out Miller's lawsuit would not take effect until Tuesday to allow time for an appeal.

Miller spokesman Randy DeSoto said there are still outstanding issues "in terms of wanting to get a true and accurate count, and we don't feel like we're there yet."

Murkowski called on Miller to concede, telling the Associated Press: "It's time to end this. It's time to say that the election is over."

The ruling marks a victory for Murkowski, who sought to become the first U.S. Senate candidate since 1954 to win as a write-in. Senators are to be sworn in Jan. 5, and the legal dispute has thrown into doubt whether someone from this race will be included. Murkowski's attorneys have argued that her seniority is at risk if she isn't sworn in then.

Miller's attorneys had asked Carey to strictly enforce a state law calling for write-in ballots to have the oval filled in, and either the candidate's last name or the name as it appears on the declaration of candidacy written in.

Miller argued that the state should not have used discretion in determining voter intent when tallying ballots for Murkowski. The state relied on case law in doing so and allowed for ballots with misspellings to be counted toward Murkowski's total.

"If the legislature intended that the candidate's name be spelled perfectly in order to count," Carey wrote in his much-anticipated ruling, "then the statute would have included such a restrictive requirement."

Unofficial results showed Murkowski ahead by 10,328 votes and still in the lead by 2,169 votes even when excluding votes challenged by Miller's campaign. Carey said that whatever interpretation he made would not change the outcome of the race, that "Murkowski has won by over 2,000 unchallenged votes."

Murkowski ran an unprecedented write-in campaign after losing the GOP primary to Miller. She focused heavily on educating voters on how to cast a write-in ballot for her.