Winning a seat representing a California congressional district is not a cheap endeavor.
In the last two years, more than $150 million was spent trying to help or hurt the candidates running for one of California's 53 seats in the House of Representatives.
Most of that money — about $117 million — was spent by the candidates' own committees while an additional $35 million poured in from outside groups looking to influence the outcome of a few key races, according to federal spending records tracked by the nonpartisan election guide California Target Book.
California's most expensive House races included some perennially contested seats as well as sleepy districts that were suddenly thrust into competition based on hopes that having Donald Trump at the top of the GOP ticket would imperil incumbent House Republicans down the ballot.
Here's a look at the priciest contests:
1. $14 million worth of mudslinging in suburban Sacramento
The most expensive race in the state saw $14.3 million spent in a swing district in the Sacramento suburbs where Rep. Ami Bera (D-Elk Grove) faced off against Republican Sacramento County Sheriff Scott Jones.
Bera spent over $4 million to keep his job, while Jones' campaign dropped in more than $1 million. But the real action came from outside spending by independent super PACs and so-called dark-money groups tied to both parties as well as special interests. That spending added up to $9 million.
The race was given extra heat by dueling scandals that were prominently featured in ads and mailers. Bera's father was sentenced to a year in federal prison for illegally funneling money to his son's congressional campaigns in 2010 and 2012. Meanwhile, Jones was accused of sexual harassment in a court deposition by a colleague in law enforcement.
2. Testing the ‘Trump effect’ in the Central Valley
Spending in a Central Valley race between three-term incumbent Rep. Jeff Denham (R-Turlock) and beekeeper Michael Eggman, a Democrat, clocked in at $14 million. Though Eggman took a 12-point beating from Denham in the district in 2014, the rematch was more competitive.
The race saw a fresh round of attacks by Democrats trying to tie Denham to Trump in a district where analysts estimate about a quarter of voters are Latino. The Congressional Leadership Fund, a super PAC that supports Republicans in Congress, responded with $3.3 million worth of attacks labeling Eggman an "extreme liberal" and a "rubber stamp" for House Minority Leader Nancy Pelosi (D-San Francisco) because he supports the Affordable Care Act.
Denham won by 3 percentage points.
3. Issa spends big to eke out a win in a surprisingly close race
San Diego area Rep. Darrell Issa (R-Vista) tapped into his campaign piggy bank to the tune of $6 million to hold back upstart Democratic challenger Doug Applegate — a race that cost more than $11 million overall.
Applegate, a retired Marine colonel and Iraq war veteran, surprised political watchers with his strong primary showing. The political novice quickly came under attack from Issa after reports surfaced that he was accused of threatening his former wife during their divorce proceedings more than a decade ago. His ex-wife later supported him in his campaign.
The only California House candidate who spent more than Issa this election cycle was House Majority Leader Kevin McCarthy, who gives a significant chunk of his money away to benefit the Republican Party and to help out other candidates since he has a safe seat.
Issa, an early Trump supporter, won a razor-thin victory by just 1,621 votes. Applegate, who benefited from more than $3 million in outside spending by liberal groups, said after the loss that he will challenge Issa again in 2018.
4. Money adds up in crowded race for open Santa Barbara seat
Democrat Salud Carbajal and Republican Justin Fareed spent a combined $5 million to replace retiring Rep. Lois Capps (D-Santa Barbara). Carbajal won the race by more than 6 percentage points, but the race still attracted about $3.6 million in outside spending from party-affilated groups as well as a super PAC backing Fareed that was funded in part by a coal giant.
Fareed, who was making his second run for the House at the age of 28, also saw a surge in out-of-district support from donors tied to two businessmen from L.A.'s Westside — some of whom didn't know who Fareed was when asked.
Total spending in the race added up to more than $10 million thanks in part to spending by prominent candidates who failed to make it out of the primary.
5. A contentious fight in the Antelope Valley
The fight between freshman Rep. Steve Knight (R-Palmdale) and first-time Democratic candidate Bryan Caforio was closely watched by national analysts going into election day. Knight's shaky fundraising, waffling on his support for Trump and a caught-on-tape confrontation with a protester in 2015 made Democrats and political observers think he could lose in this Antelope Valley swing district.
Democrats unleashed a wave of attacks ads on Knight, hitting him for his staunch opposition to abortion and comments he made in a May debate calling Social Security "a bad idea."
But Caforio, a well-heeled lawyer who moved into the district shortly before entering the race, never overcame his outsider status among voters in the traditionally Republican area that stretches from Lancaster west through Santa Clarita into Simi Valley. He lost by 6 percentage points.
Republicans labeled Caforio as "not one of us" in one ad and highlighted a Times story that looked at Caforio's six-year tenure at Century City law firm Susman Godfrey, where he represented large corporations and multimillionaires.
The race cost more than $8 million, with more than $5.2 million coming from outside groups.
Follow @jpanzar on Twitter