Candidates, political parties and their allies dumped more than $30 million as they fought a brutal campaign for control of state government, according to final 2016 campaign finance reports released Wednesday.

The two sides spent nearly two-thirds of the money on just 26 districts — 16 in the House and 10 in the Senate, according to a Star Tribune analysis.

At least two races saw $1 million spent for the general election, while three others cleared $900,000. The most expensive race was a Senate fight in the western suburbs that saw Sen. Paul Anderson, R-Plymouth, defeat DFLer Deb Calvert. Republicans won four of the five races that topped $900,000.

The DFL outspent Republicans in the House and especially the Senate, where the difference was significant. Despite that, Republicans had a net pickup of six seats in the Senate, giving them a narrow one-seat majority.

The House GOP — already in the majority — strengthened its hold on the lower chamber, extending its advantage to 76-57, despite being outspent by the DFL and its allies.

For DFL operatives, the new reports are wince-inducing because of the huge sums spent on what turned out to be lost causes.

The DFL Senate caucus raised more than $4 million. The House DFL caucus also raised nearly $4 million. Much of the caucus money was spent by the state party, which spent nearly $10 million on the campaign, including a sophisticated voter identification and turnout operation that was overwhelmed by support — especially in greater Minnesota — for President Donald Trump and his fellow Republicans down the ballot.

The Republican Party of Minnesota, still mired in debt after financial problems that extend back years, spent just $840,000. Via the GOP House and Senate caucuses, however, Republicans held their own on the money front. Speaker Kurt Daudt, R-Crown, seen as an early GOP front-runner in the 2018 governor's race, showed he is a competent fundraiser, as the House Republican caucus spent more than $2.9 million to defend and ultimately expand their majority.

Senate Republicans outsourced much of the campaign to Minnesota Action Network, an independent group aligned with former Sen. Norm Coleman. That group spent $1.1 million to help win the Senate.

Major DFL donors included labor unions like AFSCME and Education Minnesota, which spent $2.9 million in 2016 races. Wealthy individuals like attorneys Jeff Anderson and Vance Opperman and Rockefeller heir and philanthropist Alida Messinger also gave heavily. Major Republican donors included broadcaster Stanley Hubbard, Joan Cummins and industries like the homebuilders.

The final 2016 reports also show that the 2018 race for governor is underway. St. Paul Mayor Chris Coleman raised more than $190,000 for his gubernatorial campaign. Rep. Erin Murphy, DFL-St. Paul, who is also running for governor, raised more than $100,000. State Auditor Rebecca Otto, who has also announced a run for governor, moved $20,000 from her auditor account to her new campaign. Former Rep. Ryan Winkler raised $85,000 in his race for attorney general.