AP Photo/Jeff Chiu

Lt. Gov. Gavin Newsom and Republican businessman John Cox will face off in the November general election for California governor after landing the top two spots in the state’s primary.

Antonio Villaraigosa, the former mayor of Los Angeles, trailed and conceded the race.

“It looks like voters are going to have a real choice in November, between a governor who is going to stand up to Donald Trump and a foot soldier in Trump’s war on California,” Newsom told supporters after the race was called.

Cox, a former Illinois resident who ran in multiple elections there, was relatively unknown in the state before President Trump sent out several tweets in support of him in recent weeks.

“One party rule in Sacramento is bad enough, but one party elections is just un-American,” Cox told supporters, referring to the possibility, which seemed very real just a few months ago, that Republicans would get shut out of the gubernatorial race in the November election.

Villaraigosa sought to face-off against Newsom in what would have been a battle between Democrats from the northern and southern part of the state. The scenario looked likely until very recently, as polls showed Cox gaining ground.

Popular on Variety

“Different parties, different views of the world,” Villaraigosa said of the ultimate results.

The attention of Democrats nationwide wasn’t fixated on the governor’s race but a slew of House races, as the party’s hopes of winning back the majority hinge on flipping Republican seats in the state. The GOP holds seats in seven districts that Hillary Clinton won in 2016; Democrats need to win 23 seats nationwide this fall to win the House majority.

It appeared that Democrats were spared a worse case scenario: being shut out of one or several contests because of the state’s open primary. The top two vote-getters will advance to the general election, regardless of party. Because so many Democrats were vying in a series of competitive districts, they faced the possibility of splitting the vote and not making it on the fall ballot.

That was especially true in Orange County, the once hard-right conservative bastion that has been leaning farther to the left in recent cycles. Clinton won the county in 2016.

In one of the seats, Harley Rouda held a slight lead over another Democrat, Hans Keirstead, in the race to challenge incumber Republican Dana Rohrabacher, who is viewed as vulnerable. Earlier in the evening it appeared that Democrats risked being frozen out of the race to Rohrabacher and another Republican, Scott Baugh.

A complicating factor was a snafu in Los Angeles County, where more than 118,000 names were missing from the voter rolls in what was described as a printing mistake. Among those affected: Henry Winkler, the star of “Happy Days,” who tweeted that his name was left off.

One entertainment figure, Antonio Sabato Jr., overtook another Republican, Jeffrey Burum, in the later vote count and appeared to be on his way to challenging Rep. Julia Brownley (D-Calif.) in a Ventura County district this fall.

Sabato highlighted a hardline stance on illegal immigration and his support for President Trump in a district that Clinton won handily in 2016. He told Variety that he believes the improving economy will help shift the dynamics in the district.

Another notable race was that of Sen. Dianne Feinstein (D-Calif.), who will face a fellow Democrat, Kevin de Leon, the former leader of the state Senate, this fall. She held a wide lead in the primary, but de Leon is likely to pose a generational intra-party battle for the seat.

Trump weighed in not just on the governor’s race but in congressional contests. He also sent a general tweet in support of all of the GOP candidates for Congress, and specifically named two incumbents: House Majority Leader Kevin McCarthy and Rep. Devin Nunes, the chairman of the House Intelligence Committee.

Much of Hollywood’s support in the gubernatorial race went to Newsom and Villaraigosa. Although Newsom garnered more contributions from the industry, Villaraigosa also got an assist from an independent expenditure group that highlighted his support for charter schools and education reform. Reed Hastings, the CEO of Netflix, contributed $7 million to the effort, allowing them to air ads in support of Villaraigosa in expensive TV markets.

Newsom preferred to run against Cox in the general election, on the belief that he would be easier to beat. Cox, however, said that Newsom should be “careful what you wish for.” Trump seized on Cox’s showing in a Wednesday morning tweet, writing “Great night for Republicans! Congratulations to John Cox on a really big number in California. He can win. Even Fake News CNN said the Trump impact was really big, much bigger than they ever thought possible. So much for the big Blue Wave, it may be a big Red Wave. Working hard!”

Trump has been hammering the state as one of high taxes and high crime, but California has been the center of opposition to his presidency. The state attorney general, Xavier Becerra, has challenged a number of administration policies in court. Becerra had a wide lead over other challengers and will face Republican Steven Bailey in the general election.

Seven other states held primaries Tuesday, including Alabama, Iowa, Mississippi, Montana, New Jersey, New Mexico and South Dakota.

Other races of note:

Darrell Issa’s seat: Republican Diane Harkey will face Democrat Mike Levin in another district where there was a risk of a one-party general election. The seat, which includes parts of Orange County, is currently held by Republican Issa, who is retiring.

Ed Royce’s seat: Republican Young Kim led all challengers to gain a spot on the ballot, and will face Democrat Gil Cisneros. The district, held by retiring Ed Royce, also is a pickup opportunity for Democrats.

CA-25: Democrat Katie Hill edged out Bryan Caforio to take on incumbent Steve Knight, a Republican whose seat is likely to be a target in the fall. The district covers parts of the San Fernando Valley and Palmdale.

CA-10: Democrat Josh Harder held a slight lead to gain a spot on the ballot to challenge Republican Rep. Jeff Denham — but the race was much more closer than expected. Ted Howze, another Republican, trailed Harder by less than 1,000 votes.