Washington (CNN) Spending in the 2018 elections for Congress topped $5.7 billion, making the battle for control of the House and Senate the most expensive midterm ever, a new tally shows.

Last year's spending by candidates, parties, political action committees and outside groups even shot past the $5.3 billion spent during the then-recording breaking 2008 presidential election, according to the analysis by the nonpartisan Center for Responsive Politics, which tracks political spending.

To put that eye-popping $5.7 billion figure in perspective: That's the amount of money President Donald Trump sought for his border wall in a confrontation with congressional Democrats that partially shut down the government for a record 35 days.

But it's far less than the $20.7 billion that the National Retail Federation predicts Americans will spend next week on the flowers, greeting cards, jewelry, dinners out and other romantic gestures to celebrate Valentine's Day.

Other key takeaways on midterm spending:

Read More