Democrat Jared Golden was declared the winner of Maine’s 2nd Congressional District race on Thursday following a historic tabulation of ballots using ranked-choice voting.

Golden, a Marine Corps veteran and state lawmaker from Lewiston, began the day roughly 2,000 votes behind two-term incumbent Republican Rep. Bruce Poliquin. But Golden surged past Poliquin by slightly less than 3,000 votes after the ranked-choice votes of two independents in the race were redistributed Thursday afternoon.

The final vote tally was 139,231 votes for Golden versus 136,326 votes for Poliquin – or 50.5 percent to 49.5 percent.

During a victory speech shortly after the tally was announced, Golden said that, as a congressman, he intends to stay in touch with the people of Maine he has met on the campaign trail over the last 16 months.

“I’m going to keep visiting our docks, farms and forests,” Golden said, “so the fishermen, farmers and the loggers of this state will have a chance to make their voice heard. The people of this district deserve a representative who comes to them. They deserve someone who will seek out their wisdom, who learns from their experience – who knows them well enough to know the right vote to improve their lives and to represent them.”

This is the first time in U.S. history that a congressional race was decided using ranked-choice voting, which allows voters to cast ballots for their favorite candidate but also rank other candidates in order of preference. Those ranked-choice votes only come into play when no candidate wins more than 50 percent of the vote on the initial tally.

Thursday’s vote tally may not be the end, however. Poliquin is challenging the constitutionality of ranked-choice voting in federal court, and the campaign could ask for a recount of the results.

“It is now officially clear I won the constitutional ‘one-person, one-vote’ first choice election on Election Day that has been used in Maine for more than 100 years,” Poliquin said in a statement Thursday afternoon after the results were announced. “We will proceed with our constitutional concerns about the ranked-vote algorithm.”

Poliquin and three other plaintiffs had asked U.S. District Court Judge Lance Walker to declare the ranked-choice process unconstitutional and effectively declare Poliquin the winner. They also asked for Walker to halt the tabulation process until he can consider the constitutionality question.

Golden said the ongoing lawsuit would not stop him from taking his seat in Congress in January but he did not begrudge Poliquin for pursuing the case. “That’s his right. That’s his decision and I respect that,” Golden said. But Golden also said he had read Walker’s denial of a temporary restraining order sought by Poliquin’s attorneys in an attempt to stop the ballot tabulation under the ranked-choice system.

“It does not look like the judge is likely to find there are constitutional grounds for the case to really proceed,” Golden said. “That being said, we will be seated on Jan. 3 and we will begin our work on Jan. 3.”

He also reaffirmed that he did not intend to support U.S. Rep. Nancy Pelosi, D-California, in her bid to again become the speaker of the U.S. House.

The race between Golden and Poliquin was among a handful of U.S. House races that remained unsettled more than a week after Election Day.

Walker’s order on Thursday denied the request for immediate intervention but leaves open the possibility of a legal battle over the results.

Walker cited Maine voters’ repeated support for ranked-choice voting in his ruling Thursday.

“As it stands, the citizens of Maine have rejected the policy arguments plaintiffs advance against RCV,” Walker wrote. “Maine voters cast their ballots in reliance on the RCV system. For the reasons indicated above, I am not persuaded that the United States Constitution compels the Court to interfere with this most sacred expression of democratic will by enjoining the ballot-counting process and declaring Representative Poliquin the victor.”

Poliquin held a narrow, roughly 2,000-vote lead over Golden in the four-way race. But Poliquin did not receive a clear majority of votes needed to win outright, thereby pushing the tabulation to voters’ second- – or perhaps third- – choice candidates until one of the front-runners crested the 50 percent threshold. Supporters for the two independents in the race, Tiffany Bond and William Hoar, ultimately decided the election via how they ranked Golden and Poliquin.

Of the second-choice votes redistributed Thursday, Golden received 10,232 while 4,695 went to Poliquin. More than 8,000 of the ballots cast for independents did not designate a second choice.

This is the first congressional race in the nation to be decided using the ranked-choice voting process. Maine voters have endorsed the ranked-choice process twice via two separate ballot questions.

Golden’s victory means Democrats nationwide have flipped yet another Republican seat in the House of Representatives.

A total of 35 House Republicans have so far been unseated by Democratic challengers. The so-called “blue wave” has expanded the party’s majority to a total of 230 seats versus 198 won by Republicans. Those numbers will change because there are still seven too-close-to-call House races in other parts of the country.

Poliquin’s constitutional challenge will still be heard by the court, leaving some lingering uncertainty about control of the seat. The lawsuit claims the use of ranked-choice voting violates the U.S. Constitution because the document “sets a plurality vote as the qualification for election” to Congress.

However, the U.S. Constitution does not mention plurality or ranked-choice voting, and several constitutional scholars have said the suit is not likely to succeed.

In his ruling against stopping the count Thursday, Walker said the underlying lawsuit filed by Poliquin and three other 2nd District voters seeking a permanent injunction to stop ranked-choice voting would proceed with an initial hearing scheduled in early December.

Members of the media, campaign representatives and interested parties crammed into a state conference room Thursday morning ahead of the tabulation. Staff in Secretary of State Matthew Dunlap’s office have been scanning and downloading ballots from the 2nd District since last Friday in preparation for running the results through the ranked-choice voting software.

That final retabulation process only took a few minutes. As cameras streamed live footage onto TV and the internet, Dunlap dissected the numbers and announced Golden as the winner after the software allocated the ranked preferences of voters who initially cast ballots for Bond or Hoar.