Democrat Gavin Newsom won Tuesday's primary in the race for California governor and Republican John Cox finished in a strong second place, ensuring Republicans won't be shut out of the race to replace retiring Gov. Jerry Brown.
With a major boost from President Donald Trump's endorsement, Cox consolidated Republicans and edged past Democrat Antonio Villaraigosa, an early favorite to advance.
But Cox faces long odds in deeply liberal California, where Republicans are increasingly marginalized in state politics.
The race is one of hundreds of contests across the state that could solidify Democratic dominance and reshape the fight for control of the U.S. Congress.
Newsom, the former San Francisco mayor, was the first candidate to announce a bid for governor more than three years ago and was strongly favored for the top slot. He leaned heavily on his decision in 2004 to issue marriage licenses to same-sex couples in San Francisco, touching off years of debate over gay marriage in California and around the country.
In victory, Newsom wasted no time framing the general election as a fight with Trump.
"We're engaged in an epic battle, and it looks like voters will have a real choice this November _ between a governor who is going to stand up against Donald Trump and a foot solider in his war on California," Newsom told cheering supporters at his victory rally in San Francisco's Mission District.
Because of California's "jungle primary," the top two vote-getters -- regardless of party -- advance to a runoff in November.
In the race for governor, Cox defeated Villaraigosa, who was an early favorite to advance but trailed in recent months despite more than $20 million in spending on his behalf by charter school advocates.
Cox, a businessman from San Diego has run unsuccessfully for a number of offices in his native Illinois but gained footing among California Republicans as the campaign progressed. He and Travis Allen both aligned with Trump _ Allen repeatedly noted Cox voted for Libertarian Gary Johnson in the 2016 presidential election; Cox said he regrets the choice.
``This is only the first step to turning around this state and taking back California for all Californians,'' Cox told supporters in San Diego.
Trump is a popular punching bag for Democrats and unpopular with independents but maintains strong support and loyalty from the GOP base.
"I don't think there will be a blue wave at all,'' registered Republican Keith Smith, 66, said outside a Solana Beach polling place where he voted for Cox.
The campaign played out largely under the radar despite millions of dollars in spending by candidates and their independent supporters. The closing days of the race were marked as much by dueling complaints over that spending as by differences between the candidates, their priorities and their styles of governing.
Sean Spicer, 42, a San Diego resident who works in marketing, said he voted because it's a civic duty _ though he doesn't like California's top two primary system and said it is showing its shortcomings this year.
"We have 7,000 candidates vying for governor and so the top two primary system means you end up voting for people who you think can win not who you believe in,'' he said.
Evelyn Corado, a 50-year-old preschool teacher from Huntington Beach and naturalized U.S. citizen from El Salvador, chose Villaraigosa for governor.
"He was already mayor of Los Angeles and I saw him do a lot for the Hispanic community,'' she said after casting her ballot.