BURLINGAME, Calif. — Lt. Gov. Gavin Newsom (D) will face businessman John Cox (R) for California governor in November as voters on Tuesday winnowed a field of nearly 30 candidates.

The Associated Press called the race for Newsom at 12:17 a.m. EDT. NBC News and Fox News called the race for Cox shortly thereafter.

Newsom was long the Democratic front-runner and led polls of all candidates virtually from the beginning of the race. He benefited from endorsements from prominent labor unions and liberal groups, and he raised more than any other candidate. Cox secured the second spot on the November ballot after battling three other well-funded contenders on Tuesday — Los Angeles Mayor Antonio Villaraigosa (D), state Treasurer John Chiang (D) and Assemblyman Travis Allen (R). Cox began rising in the polls after winning an endorsement from President Trump , who tweeted his support last month. Newsom will begin the sprint to November as the overwhelming favorite in a state where registered Democrats outnumber registered Republicans by a nearly 2-to-1 margin.

But the fact that Cox secured the second position over Villaraigosa and Chiang is something of a coup for California Republicans. Though the race is not likely to be competitive, Republicans had worried that two Democrats advancing to the general election would have led to a precipitous drop in turnout among Republican voters.

Cox – who has previously run for Congress, Senate and president in both Illinois and California – has a personal fortune he is likely to dip into as he mounts his general election campaign.

The businessman has already given himself more than $4 million. As of May 19, the last time the campaign was required to file a financial report with the secretary of State, Cox had just $124,000 in the bank.