Two years ago, Republican Meg Whitman spent $178.5 million in a failed attempt to be elected governor of California. It was the most expensive nonpresidential campaign in U.S. history.

President Barack Obama and Gov. Mitt Romney just waged a $4.2 billion campaign for the White House - the highest amount ever.

And three high-stakes political races in San Joaquin County topped a combined $24 million.

That total does not reflect the hundreds of thousands of dollars spent on less-competitive state races or on municipal elections.

As Jesse Unruh, speaker of the California Assembly in the 1960s, once said: "Money is the mother's milk of politics."

Money was spent by the bucketful leading up to Tuesday's General Election. The final totals aren't in, but here's a look at the county's trio of expensive races:

» 10th Congressional District (southern San Joaquin County): Between them, Rep. Jeff Denham, R-Turlock, the winner, and Democratic challenger Jose Hernandez had at least $6 million spent on trying to defeat one another.

» Fifth State Senate District: With supermajority control of the Legislature's upper chamber on the line, two Assembly members who live in Stockton, Republican Bill Berryhill and Democrat Cathleen Galgiani, watched while $12 million was spent trying to achieve that aim. Berryhill narrowly leads, but both campaigns are watching while late mail-in and provisional ballots are counted.

"We've never had this kind of political attention," said 59-year-old Don Parsons, a political consultant and owner of Stockton-based Strategic Research. "We had more money spent in this area than typically in the past. It was because of the number of competitive races."

Much of what was spent was raised by anonymous groups outside San Joaquin County, and the majority of it also was spent outside - in the Sacramento TV market.

Adding to the flow, and the confusion, is the rise of 501(c)4 nonprofit advocacy organizations, political action committees and Super PACs.

Donors stay secret by contributing to the 501(c)4s, which in turn contribute to the Super PACs.

Hundreds of millions of dollars has been unleashed since the U.S. Supreme Court's 2010 Citizens United decision that allows unlimited corporate and union spending.

"I actually think less money is a good thing, but the problem is - when you get to larger geographic areas - you can't possibly communicate with enough people to win," Parsons said. "Money gives you the ability to communicate. That said, too much money in the system overwhelms the voter."

In the McNerney-Gill, Denham-Hernandez and Berryhill-Galgiani races, much of the funding came either from independent expenditure committees or the national or state parties. All three produced mountains of mail and a blizzard of TV ads.

"We seem to be gravitating in this direction," said Scott Winn, who helped create the Stockton-based Central Valley PAC over the summer.

"We're seeing more from independent expenditures instead of the campaigns themselves. The campaigns are taking care of ground operations. This is the reality we're moving toward."

Winn is a 40-year-old political consultant "and data guy with VoterLink Inc." His new political action committee is devoted to raising funds to help candidates "from Sacramento to Bakersfield."

Parsons, who helped direct 11 campaigns this year, has been a political consultant for 20 years. He saw a downside for county supervisor, school board and City Council races in the shadow of the three high-profile campaigns.

"Part of the trick for locals was to cut through all the noise of these national campaigns," Parsons said. "It was more difficult to raise money for candidates at the local level. And if you send out mailers in the midst of their onslaught, it won't get read."

Parsons also said it is unusual for the county to have even one competitive race - much less three - for either Congress or the state Legislature.