* * *

The gusher of outside money into Montana's Senate race was part of a larger pattern. Nationally, in addition to the $5.1 billion spent by candidates and parties, almost 700 outside spending groups dumped more than $1 billion into federal elections in the 2012 cycle, FEC filings show.

Of that, about $322 million was dark money, most of it from 153 social welfare nonprofits, groups that could spend money on politics as long as social welfare — not politics — was their primary purpose.

Relating those numbers to previous elections is a largely pointless exercise, akin to comparing statistics from baseball and lacrosse. The Citizens United ruling changed the game, opening the door to unlimited corporate donations to super PACs and to a new breed of more politically active nonprofits.

"Instead of being in a boxing match in a ring, you're in a dark alley being hit by four or five people, and you don't know who they are," said Michael Sargeant, the executive director of the Democratic Legislative Campaign Committee, which helps Democrats run for state offices.

Some of the players in the 2012 cycle were longtime activist organizations such as the liberal Sierra Club and the conservative National Right to Life Committee, with clear social welfare missions and only a limited amount of political spending. Other dark money groups were juggernauts like Crossroads GPS and Americans for Prosperity, founded years ago by conservative billionaire brothers Charles and David Koch, which crank up their fundraising during election years and devote more money to election ads than other nonprofits.

Finding out about some of the less prominent nonprofits was no easy feat. Many were formed out of post-office boxes or law firms. On their applications to the Internal Revenue Service, they minimized or even denied any political activity.

Documents for pop-up nonprofits like the conservative America Is Not Stupid and A Better America Now, both of which formed in 2011, led back to a Florida law firm that offered no explanations. The Citizens for Strength and Security Action Fund, a liberal pop-up group that spent millions on elections in 2010, closed down in 2011. In its place came a new group: the Citizens for Strength and Security Fund, which earlier this year bought almost $900,000 in ads attacking Rehberg and the Republican Senate candidate in New Mexico.

Groups picked names that seemed designed to confuse: Patriot Majority USA is liberal. Patriotic Veterans is conservative. Common Sense Issues backed conservatives. Common Sense Movement backed a Democrat.

As in the 2010 midterms, the dark money spent in 2012 had a partisan tilt. Conservative groups accounted for about 84 percent of the spending reported to the FEC — mainly through Crossroads GPS, Americans for Prosperity and the U.S. Chamber of Commerce. Liberal groups spent 12 percent of the dark money. Nonpartisan groups made up the rest.

Despite shelling out hundreds of millions of dollars, conservatives lost big. Only about 14 percent of conservative dark money went to support winners.

Still, campaign-finance reformers say it's a mistake to minimize the influence of this money.

"What these donors were buying was access and influence, not only to the candidates but to the party machine," said Paul S. Ryan, senior counsel for the Campaign Legal Center. "And they will get that access. On the Republican side, you have people lining up to kiss the ring of (billionaire donor) Sheldon Adelson. And on the Democratic side, you have even people critical of these groups meeting with the funders of these groups. This money is not going away."

Even though liberal groups spent far less than conservative ones, they had a higher success rate. About 70 percent backed winning candidates.

Some Democrats have shown distaste for the dark-money arts, pushing for more transparency. But liberal strategists are preparing to ramp up their efforts before the next election, unless the IRS, Congress or the courts change the rules.

"We probably have a lot less comfort with some of the existing rules that allow for the Koch brothers to write unlimited checks to these groups," said Navin Nayak, the senior vice president for campaigns at the League of Conservation Voters, a liberal social welfare nonprofit for more than 40 years. "But as long as these are the rules, we're certainly going do our best to make sure we're competitive and that our candidates have a shot at winning. We're certainly not going to cede the playing field to the Koch brothers."