Although California’s top-of-the-ticket races were said to be decided before voters even walked into the polls Tuesday, the show had to go on for the many legislative races at stake.

Voters sorted through an array of candidates, in some cases choosing from half a dozen or more, to set the stage for matchups in November.

With 26 seats up for grabs this election cycle, interest groups stepped up spending in hopes of influencing the competitive landscape.

Outside groups including oil companies, education advocates, unions and business groups have spent nearly $29 million, a record for the June primary that far outstripped the $16.7 million in spending two years ago.

Overall, one thing became strikingly clear: Early indications of depressed GOP votes in the presidential primary did not bode well for the fortunes of some Republicans in these races.

Republicans shut out of 14 contests

Thanks to California’s top-two primary system, voters will be left to choose between two Democrats in closely watched contests with vulnerable incumbents and open seats in safe Democratic districts.

One race that might have been particularly influenced by low Republican turnout was Assembly District 43, where five Democrats battled for votes. Democrats Ardy Kassakhian and Laura Friedman were able to advance past Republican Mark MacCarley, who trailed Kassakhian by eight percentage points.

Weak showings from GOP candidates

Republican incumbents in Southern California were looking especially vulnerable after Tuesday’s returns rolled in.

Preliminary results showed Assemblyman David Hadley (R-Manhattan Beach) — considered one of the most at-risk — trailing Democratic challenger Al Muratsuchi, who he beat in 2014 by just 700 votes.

“Clearly, the large turnout yesterday was a reflection of the high level of interest in the presidential election and, in particular, the polarizing effect of Donald Trump,” said Muratsuchi, who has tried to tie his opponent to the presumptive Republican presidential nominee.

In nearby Orange County, Sharon Quirk-Silva, another Democratic challenger who formerly represented the Assembly district, beat Assemblywoman Young Kim (R-Fullerton) by six percentage points in preliminary results.

And in the Inland Empire’s Assembly District 40, Republican incumbent Marc Steinorth of Rancho Cucamonga was ahead of first-time candidate Abigail Medina, a Democrat, by just 300 votes.

There was more than $250,000 in independent expenditures spent on his campaign by pro-business groups.

SIGN UP for our free Essential Politics newsletter >>

Big bets from deep pockets pay off

In a handful of races, heavy spending helped shape the races this fall. Among them is the contest to replace Sen. Fran Pavley (D-Agoura Hills), a key figure in the progressive, pro-environment wing of the state Democratic caucus. More than $1 million was spent on various Democrats vying for a spot in Senate District 27. But almost half of that was spent in the last two weeks of the campaign by a union-backed committee supporting Henry Stern, a senior policy advisor to Pavley. He ultimately beat out well-funded fellow Democrat Janice Kamenir-Reznik for a spot in the top-two primary against the sole Republican, Steve Fazio.

In Northern California’s Assembly District 4, interest groups spent more than $2.7 million in outside spending, most of it by business groups, education advocates and oil companies, to support Democrat Cecilia Aguiar-Curry and to oppose Dan Wolk, another Democrat. Aguiar-Curry narrowly edged Wolk out of the second spot and will face Republican Charlie Schaupp in the fall for this safe Democratic seat.

A few upsets

A few days ago, Assemblywoman Ling Ling Chang’s (R-Diamond Bar) main opponent for state Senate District 29 appeared to be Democrat Sukhee Kang, a former mayor of Irvine who had the backing of the California Democratic Party and a host of state lawmakers. But in a surprise upset, veterans advocate Josh Newman, who reported spending less than a quarter of what Kang did, pulled ahead of Kang and appears headed to the runoff. It remains to be seen whether Democratic allies will line up behind Newman in an attempt to recapture this Senate seat.

And in the race between incumbent Assemblywoman Patty Lopez (D-San Fernando) and Democrat Raul Bocanegra, who previously held her seat, Lopez was trailing her challenger by nearly 20 points. Lopez has complained that she has suffered from lack of support from her fellow caucus members.

Expensive intraparty fights

Among the many races where Democrats will square off against fellow party members, a few are likely to attract even higher levels of outside spending.

They include the race for Assembly District 27, where education and business groups supporting Madison Nguyen were responsible for most of the race’s $2.7 million in independent expenditures. She faces fellow Democrat Ash Kalra, who beat out Republican Van Le to advance to November.

Oil companies and progressive and labor groups lined up on separate sides in the race between business-aligned Assemblywoman Cheryl Brown (D-San Bernardino) and her challenger, attorney Eloise Reyes. In what has become one of the most expensive state races of the year, the campaign between Brown and Reyes could be a referendum on what kind of Democrat will best serve the Inland Empire.

Look out for big spending, too, in the Bay Area Assembly race between Mae Torlakson and Tim Grayson, which could evolve into a proxy fight between the California Teachers Assn. and education advocacy groups.

The fight for a supermajority

As the Republican Party continues to fade in the state and with interest groups seeking to influence what kind of Democrats are elected instead, money that might otherwise go toward helping Democrats further establish their dominance could get tied up this election season.

That could affect Democrats’ hopes of targeting vulnerable Assembly Republicans such as Hadley and Kim, but also their hope of maintaining a seat such as Senate District 27, where former Assemblyman Anthony Portantino beat out a crowded field of Democrats and will face Republican Mike Antonovich, a well-known L.A. County supervisor, in the fall.

Times staff writer Chris Megerian contributed to this report.

For more on California politics, follow @cmaiduc.

ALSO:

Top legislative races in California: What we're watching

California primary live updates: Rematches and Democratic battles take shape for fall

Updates on California politics

Top-two primary yields surprises, relief for California candidates and incumbents