This year’s 2nd District congressional race was the most costly federal election in Maine’s history.

At least $24.3 million was spent on swaying voters in the largely rural district, counting contributions to the candidates and outside spending by political groups aiming to influence the outcome in a hotly contested race.

Campaign finance reports filed with the Federal Election Commission show Democrat Jared Golden, who won pending a recount, spent $5.6 million compared to the $4.1 million that incumbent Republican Rep. Bruce Poliquin shelled out in his quest to secure a third term.

Candidate totals were dwarfed, however, by the $13.5 million dumped into the race by outside groups such as the Republicans’ Congressional Leadership Fund and the Democratic Congressional Campaign Committee.

This year’s 2nd District race topped the 2016 contest in which Poliquin defeated Democrat Emily Cain. That race cost about $18.3 million.

The next costliest race for federal office was in 2008, when Sen. Susan Collins’ re-election cost $17.6 million at a time when outside spending was much less of a factor. That year, outside committees accounted for only $3 million of the overall tab.

Golden said his campaign was “really surprised at the amount of money that we raised.”

What happened this year, he said, is that more than 60,000 individual donors sent money to his campaign, most of it online without anyone even asking for it. Act Blue, a Democratic crowdsourcing site, helped raise a large chunk of it.

Golden received 23 percent of his contributions from individuals who gave $200 or less. Nearly all of the rest came from other donors who gave no more than $2,700 for the general election, though some also chipped in another $2,700 during the Democratic primary.

Poliquin raised 2 percent of his money from those donating $200 or less. More than half his money – 54 percent – came from political action committees. Golden received 7 percent of his campaign cash from PACs.

Golden said he figured the average donor gave him about $70.

“That is the best way you can raise money for a political campaign,” he said.

Getting hundreds of thousands of dollars without having to do anything to receive it, he said, “meant I got to spend more time meeting with voters” across the district instead of sitting in a room making phone calls to potential donors, a staple of big-time political campaigns for decades.

Because he did not need to make those calls, Golden said, “it allowed me to run a more old-school campaign” that depended largely on personal contact with as many voters as possible across the sprawling district, the largest east of the Mississippi River.

Poliquin, who could not be reached for comment, was outspent in both of his previous congressional runs as well.

In 2016, Cain shelled out a little more than the $3.4 million Poliquin spent. In his first race, in 2014, Poliquin spent $1.7 million in a three-way race in which Cain spent $2 million and independent Kevin Raye nearly $400,000.

Golden said he intends to push hard for reform of the campaign finance system, including strong support for H.R. 1, a bill Democrats are drafting to create automatic national voter registration, expand online registration and require political groups to disclose donors.

It also contains provisions to impose an ethics code on the Supreme Court, mandate the disclosure of tax returns from presidents and other measures aimed at bolstering ethical standards in Washington.

Golden said the bill offers provisions that constitute “a big part of what I campaigned on” in terms of trying to limit the influence of big money.

He said that one of the things that “baffles me” is that individual donors to a candidate’s campaign are limited to $2,700 while billionaires are free to give whatever they want to Super PACs.

“That just seems astounding and wrong,” Golden said.

[email protected]