Updated at 11:59 p.m. ET
"It's safe to say Alaskans have chosen the path to unity," said Sen. Lisa Murkowski Wednesday night to a group of supporters.
She went on to thank Alaskans who chose to write her name in on the ballot. "Now the real work begins," she said.
History, the GOP, the tea party, Sarah Palin and her own mouthful of a name worked against her. Republican Sen. Lisa Murkowski conquered them all Wednesday, becoming the first Senate candidate in more than 50 years to win a write-in campaign.
The victory is a remarkable comeback for Murkowski, who lost to political newcomer Joe Miller in the GOP primary, and a humbling moment for Palin, the former Alaska governor, 2008 GOP vice presidential candidate and Murkowski nemesis whose support was not enough to get Miller through an election in her own backyard.
The outcome became clear after a tedious week of counting handwritten ballots. Alaska election officials confirmed they had only about 700 votes left to count, with Murkowski ahead by 10,400 votes. Miller has challenged 8,153 of the ballots counted for Murkowski, but he would still be behind even if he won each challenge.
Murkowski declared victory after flying from Washington, D.C., to Alaska on Wednesday, exactly two months after announcing her write-in bid.
"Doesn't it just feel like, wow," she said at an Anchorage rally. "It feels a little bit mind-boggling."
She called for unity and wished Miller and Democrat Scott McAdams, who conceded last week, well. Then she called for a night of celebration, telling supporters that "against all odds, we as Alaskans, together, made history."
Miller said he may ask for a re-count. Miller has maintained he'll stop fighting if the math doesn't work in his favor, and his spokesman, Randy DeSoto, said late Wednesday that Miller will discuss matters with his campaign and legal teams, and "decisions will be made shortly."
The state GOP, which backed Miller, called the race for Murkowski and asked Miller to withdraw. Murkowski's run caused a rift, and state GOP chairman Randy Ruedrich whom Miller once tried to oust said the party "stands ready to embrace Lisa Murkowski as Alaska's only Republican U.S. senator."
"We call on Joe Miller to respect the will of the voters and end his campaign in a dignified manner," Ruedrich said.
Murkowski will return to Washington owing nothing to tea party activists, who largely opposed her, or to the Republican Party, which supported Miller after the primary. Though she plans to caucus with Republicans, she said she won't be beholden to any special interests or party an initial sign that she may not try to reclaim her leadership post within the GOP conference. She voluntarily resigned it in deciding to make her outsider run.
She's already standing against the tea party on one hot issue earmarks that allow lawmakers to steer federal spending to pet projects. Former GOP defenders including Senate Republican leader Mitch McConnell now want to ban earmarking, but Murkowski say a ban won't do much to reduce federal spending and would leave bureaucrats to decide spending priorities.
Murkowski's write-in bid almost didn't happen. After losing to Miller in August she went back and forth before deciding to run, saying she had been encouraged by Alaskans who wanted an alternative between the conservative Miller and the little-known Democratic nominee.
The last Senate candidate to win as a write-in was Strom Thurmond in 1954, and no write-in campaign on this scale had ever succeeded in Alaska. But the long-shot nature of Murkowski's campaign seemed to invigorate the senator and her team.
She showed a fire she'd lacked during the primary, when she referred to Miller as "my opponent" and fell victim to aggressive last-minute attack ads by the Tea Party Express.
This time, she pounced on Miller's every misstep. While she still stressed her seniority and her willingness to be a voice for all Alaskans, her speeches sounded more like rallies than lectures, generally ending in her leading a raucous chorus of supporters in spelling her name: "M-U-R, K-O-W, S-K-I."
"She just had a fire in her belly to do this not for herself but for the large number of people, literally hundreds, who begged her to do this," said John Tracy, who worked on her ad team.
Murkowski wasn't the typical write-in candidate: She enjoyed widespread name recognition as Alaska's senior senator and daughter of a local political dynasty, and had a $1 million-plus bank account.
Miller, meanwhile, had several missteps after the primary. Court documents were released showing that he had been suspended as a government employee for using work computers for partisan political work and lying about it. In other miscues, his security detail handcuffed a journalist asking questions at a town hall meeting, and it was revealed his family received many government handouts that he railed against as a tea party candidate.
Murkowski's victory became apparent after days of ballot counters and observers scrutinizing the handwriting of more than 100,000 ballots bearing her name.
It was a process unlike any Alaska had seen, with the rules for conducting the election written as the race went on. That provided the crux of Miller's federal complaint that the determination of votes was subjective and not strictly in line with election law. The law calls for write-in ballots to have the oval filled in and either the candidate's last name or name as it appears on their declaration of candidacy written.
Miller observers, seeking to hold the state to that standard, objected to thousands of ballots, including ones with a cursive letter or two, slight misspellings or mangled lettering. The campaign even challenged ballots that read "Lisa Murkowski Republican" or "Murkowski, Lisa."
Murkowski told supporters at Wednesday night's rally that "after eight weeks, I think we can say our miracle is here."
"I promised during this campaign that I would do everything, everything that I could do to best represent you," Murkowski said, her voice shaking at times. She added later: "I pledge to you today and from this day forward that I will do everything that I can to keep that commitment to you all."
There's no threshold for demanding a re-count, but if Miller is more than roughly 950 votes behind Murkowski, he will have to pay for it himself. The state hopes to certify the race Nov. 29; the deadline to then request a re-count is Dec. 4.
Murkowski, 53, was appointed to the Senate seat long held by her father when he became governor in 2002; she won the seat in her own right two years later, in a narrow win over Democrat Tony Knowles. Her father was ousted in the 2006 gubernatorial primary by Palin, contributing to the icy relationship between the two families.
Levi Russell, a spokesman for the California-based Tea Party Express, told The Associated Press that Murkowski's failure to win a majority in the race "demonstrates a rejection of her well-known policies."
While disappointed in the race's outcome, Russell said the group stands behind its strategy and Miller. "We continue to feel that Joe Miller is more in concert today with the people in Alaska, who are concerned about the growth and intrusiveness of the federal government with the higher taxes, deficits and national debt," he said.
The win comes a day before what would have been Sen. Ted Stevens' 87th birthday. Stevens, a legend in Alaska for bringing home billions in federal aid and projects during his 40 years in the Senate, was one of Murkowski's biggest supporters, and a mentor. He died in a plane crash two weeks before the primary. Members of Stevens' family were at Wednesday night's rally.
Murkowski invoked his legacy during her write-in campaign as something she wanted to carry on.