Democratic Rep. Rick Nolan won a narrow victory again over Republican Stewart Mills in the battle for Minnesota's northeastern congressional district, an election that was among the state's closest U.S. House races.

As of early Wednesday, Nolan led by a little more than 2,000 votes.

Nolan was running for his third consecutive term in the House, though he also served in Congress in the 1970s. He faced Mills, a member of the family that built the Mills Fleet Farm empire, who narrowly lost the same race two years ago.

Nationally, both Republicans and Democrats saw the sprawling Eighth Congressional District, which spreads from the northern Twin Cities exurbs to the Canadian border, as a toss up. So they threw more than $17 million in mostly negative advertising on TV and radio to try and sway about 650,000 voters.

It was the country's most expensive U.S. House race.

Two years ago, Nolan won by fewer than 4,000 votes. This year, he faced stiff headwinds because of Republican presidential nominee Donald Trump, whose fierce stands against trade agreements galvanized working class voters and helped Mills, who openly supported Trump.

"I am cautiously optimistic and more [cautious] than optimistic because I understand exactly how competitive it is, and it all depends on who shows up to vote," Mills said. "I am confident that I won on the issues."

Mills and his family recently sold off their business to a private firm, and he subsequently plunged almost $2 million of his own money into the race.

In the last two years, the Eighth was heavily beset by job losses — particularly among miners on the Iron Range — which made even lifelong DFLers turn against incumbent politicians. Even in the district's deeply blue Democratic areas, there was more enthusiasm for Sen. Bernie Sanders and his spirited arguments against the establishment than for Democratic presidential nominee Hillary Clinton.

Both Mills and Nolan received a lot of attention from the top of their respective tickets throughout the campaign.

Sanders paid a visit to rally college students. Vice President Joe Biden last month went to Duluth, where over the weekend Republican vice presidential nominee Mike Pence urged those on the fence to "come home" to Trump.

Nolan spent much of the past year working to bring back iron ore mining jobs, challenging the U.S. International Trade Commission to crack down on foreign countries dumping cheaper steel into the market and pushing the White House to help where it could. He even got President Obama's chief of staff, Denis McDonough, a native Minnesotan, to visit the Range in December 2015 to hear firsthand of the workers' struggles.

"There is a tendency to blame people who have been in power for a long time," Nolan said. "I have a pretty good feel for why people are frustrated and I understand it."

Even though 1,000 jobs have returned since McDonough's visit, the anti-incumbency mood is palpable on the Range and in some of the district's rural areas. Mills has been outspoken about not supporting an Obama-led trade agreement called the Trans Pacific Partnership. He has called Nolan "completely ineffective" and much of his work a "dog and pony show."

Mills pledged to compromise if he gets to Capitol Hill, saying his years in the family business had prepared him for compromise.

"I've learned to take no for an answer, I've learned to take yes for an answer and I've learned to take maybe for an answer," Mills said. "I've learned how to compromise. I've learned how to work with people who have different ideas."

Allison Sherry • 202-662-7433