As polls projected, Newsom jumped out to a big lead in the initial results Tuesday night. Second place took longer to determine, until Cox had firmly established a substantial lead over former Los Angeles Mayor Antonio Villaraigosa.
Under California's primary system, the top two vote-getters regardless of party face off in the general election. There were 27 gubernatorial candidates on the ballot.
Cox, who was endorsed by President Donald Trump, had surged in polls in recent days, although Republican registration has fallen off for years throughout California. The party has not won a statewide contest since Arnold Schwarzenegger was re-elected governor in 2006.
Newsom had focused on attacking Cox in the primary and linking his record and values to President Donald Trump.
"Our values are under assault," Newsom said. "We're engaged in an epic battle. It looks like voters will have a real choice this November: Between a governor who's going to stand up to Donald Trump and a foot soldier in his war on California."
By 11 p.m., Villaraigosa acknowledged that he was not going to finish among the top two and he congratulated Newsom.
"Gavin: thank you for caring enough about this state to put your hat in the ring," Villaraigosa said. "We all acknowledge that you're the victor tonight and we thank you."
He also thanked Cox: "To John Cox, thank you as well. Different parties, different views of the world. But when you care enough to put your hat in the ring and run to be the leader of a state or country or city, you have to acknowledge that. Let's give him a hand too."
Earlier in the evening, Villaraigosa seemed reluctant to concede over concerns about problems at polling places in Los Angeles County, his biggest political base. The names of some 118,000 voters had been mistakenly left off the rolls at polling places in LA County.
Villaraigosa called on Los Angeles County to keep the polls open until Friday because of the problems.
Election officials initially said keeping the polling places open would require a court order and they had not received one, but Villaraigosa's campaign continued to engage in discussions with county and state elections officials.
Cox appeared confident his second place lead would hold up and he would face Newsom in the general election.
He was already launching into rhetoric against Newsom and the Democratic Party.
"Mr. Newsom made it clear that he wanted to run against me instead of another Democrat," Cox said. "As I told him in San Jose at the debate, be careful Mr. Newsom what you wish for."
"Mr. Newsom and his corrupt cronies, they did a bunch of ads touting their opposition to the president. Let's send him the very first message and that is: It wasn't Donald Trump who made California the highest-tax state in the country. It was Gavin Newsom and the Democrats."