After one of the most costly and closely watched campaigns in the country, U.S. Rep. Bruce Poliquin faces possible defeat.

Ranked-choice voting, in place for the first time in American history for a congressional election, is going to decide whether the Republican incumbent returns for a third term or cedes his 2nd District seat to Democrat Jared Golden of Lewiston.

As of 12:30 a.m. Wednesday, results showed a dead heat between Golden and Poliquin, with about 8 percent of the overall vote cast for the two independents who are also in the race.

Both Poliquin and Golden said they anticipated a long night of watching the numbers, but nobody involved in the campaigns disputed the likelihood that neither of them will have a clear victory until the ballots of independents are redistributed to one or the other of them.

“We’re not going to get any final results tonight,” Golden said.

Under the new voting system adopted by Mainers in two statewide ballot questions, the second- and third-place choices of the people who voted for independents Tiffany Bond and Will Hoar will be redistributed either to Poliquin or Golden, depending on which was picked before the other by individual voters.

Poliquin was generally faring worse than he did in the same towns two years ago, a positive sign for Golden.

Poliquin, the only Republican in New England to hold a congressional seat, has served since 2014, touting the economic insights he gained during 35 years in the finance field before he entered politics less than a decade ago.

Golden, a U.S. Marine Corps veteran who served in combat tours in Iraq and Afghanistan, campaigned on the need for universal health care and more help for working Mainers.

He said people are “excited for a new generation of leadership” and glad to have put him in a position where he can fight for ordinary Mainers in the nation’s capital.

Under the ranked-choice system, unless one of the top two contenders gets more than 50 percent of the overall vote, the outcome will be decided by Hoar and Bond voters who made selections beyond their first choice. Their ballots will be redistributed to their second-place choices.

There is no guarantee the first-place finisher in the initial voting will prove the winner in the end, a scenario that all of the candidates have said they will accept except for Poliquin, who didn’t rule out a challenge in court if ranked-choice voting costs him the election.

But the Democrats’ control of the U.S. House next term, because of victories elsewhere in the country, leaves them in charge of deciding whom to seat.

Golden said shortly before the polls closed that he felt calm. He said he did everything he could and is grateful that so many people helped him.

Even the possible death of his trusty truck did not not rattle him. With just a few more hours of the campaign left, Golden’s 2003 GMC Sierra — which he’s used to log more than 50,000 miles along the campaign trail — “just up and died” in Bangor, the candidate said outside Longley Elementary School in Lewiston.

Golden, who got a ride home to Lewiston while his truck was towed away, said the vehicle must have decided “enough’s enough already.” But, he said, he thinks the fuel pump may be the problem so it’s possible the truck has more miles to go before it gives up the ghost entirely.

Golden, 36, spent Election Day bouncing between polling places from Auburn to Rumford to Bangor. Poliquin, 65, focused on the Bangor area during Tuesday’s voting.

At one point in the day, the two stood together outside a polling place in Bangor. They shook hands and almost posed together for a picture with some high school students, Golden said.

Poliquin may be in trouble, but he has history on his side.

No incumbent has lost the 2nd District seat since 1916, when Lewiston lawyer Daniel McGillicuddy fell short in his bid to retain the office in a year that saw Republicans sweep Maine.

This year, though, the Democrats appeared to be having a pretty good night as returns began to come in across the country.

Cited by many political gurus as a key swing district that might wind up handing control of the U.S. House to the Democrats after eight years of GOP control, an unusual amount of national attention focused on the outcome.

Candidates and political action committees spent more than $18 million during the race, paying for more than 6,400 television commercials — about one every two minutes during the final weeks of the campaign.

Because Maine’s television advertising rates are comparatively cheap, dark money super PACs proved eager to pour money into the race. The candidates themselves raised about $9 million, with Golden’s mostly coming from individuals and Poliquin relying on contributions from PACs.

Golden, who raised more money for his own campaign than Poliquin, benefited from about 10 percent more commercials overall.

One of the biggest spenders in the district, the GOP’s Congressional Leadership Fund, spent $3.1 million on ads touting Poliquin or bashing Golden.

Like many other groups on both sides of the aisle, it also paid for a slew of spots on internet sites whose cost is not broken down. Across the country, the CLF said it shelled out about $20 million for online ads compared to less than $3 million in 2016, an indication of the growing importance of reaching voters via the internet.

In the 2nd District, the CLF also opened a field office in Bangor in March that wound up contacting about 373,000 Maine voters, identifying Republican supporters and trying to make sure they got to the polls in an especially aggressive effort.

Two years ago, Poliquin defeated Democrat Emily Cain by a 55-45 margin, racking up almost 193,000 votes in the process.

In 2014, when he first won the district, Poliquin collected 45 percent of the overall vote while Cain got 40 percent and an independent, Blaine Richardson, collected 11 percent.

Poliquin, an Oakland  resident, got into politics in 2009, when he jumped into the gubernatorial race, losing badly to Paul LePage. Poliquin went on to become the state treasurer, before coming up short in a bid for a U.S. Senate seat in 2012.

His first success at the polls came two years later, when he captured the 2nd District seat that Democrats had held for two decades.

[email protected]

Jared Golden and his wife, Isobel, greet supporters late Tuesday at the Franco Center in Lewiston. (Russ Dillingham/Sun Journal)

Jared Golden

Jared Golden greets his supporters late Tuesday at the Franco Center in Lewiston. (Russ Dillingham/Sun Journal)