SACRAMENTO, Calif. (AP/CBS13) — California’s Democratic Attorney General Rob Bonta was on pace to face the Republican Party’s endorsed candidate in the November general election in a state that overwhelmingly favors Democrats, based on early ballot returns in Tuesday’s primary.

Bonta, the only Democrat in the five-way primary field, advanced after winning 58% of the vote shortly after the polls closed.

READ MORE: Search Histories, Location Data, Text Messages: How Personal Data Could Be Used To Enforce Anti-abortion Laws

He was trailed by the GOP’s endorsed candidate, Nathan Hochman, with 17%. Hochman is a former federal prosecutor and former assistant U.S. attorney general.

Conservative Republican Eric Early was third, with 14%, while Sacramento County District Attorney Anne Marie Schubert, running without party affiliation, had 8% of the vote. Green Party candidate Dan Kapelovitz had 3% in early vote tallies.

The top two vote-getters advance to the November election under California law, no matter their party affiliation.

Independent organizations supporting Bonta spent more than $1 million on targeted messaging advising Republican voters that Early is a Trump supporter, recall leader and defender of Second Amendment rights. Early was legal counsel for the unsuccessful effort to recall Democratic Gov. Gavin Newsom last year.

The state Republican Party, in a letter distributed by Hochman’s campaign, called the tactic “dirty tricks.”

Early had finished last in a four-way primary election for attorney general in 2018 and this year was far behind other candidates in campaign fundraising.

Hochman and Schubert both said Bonta allies were trying to sideline their campaigns that might have greater appeal to centrist voters and thus pose a greater risk to Bonta in a general election.

Any Republican is considered a longshot, however.

READ MORE: Toyota Recalls Its First Mainstream Electric Car Because The Wheels Can Fall Off

The party hasn’t won a statewide election since 2006, and its last California attorney general left office in 1999.

Bonta’s opponents hope to oust him this year by focusing on what they say are Democratic failures to curb violent crime and reduce homelessness.

Bonta has never before run a statewide race and previously was one of the state’s most progressive lawmakers, representing a San Francisco Bay Area district in the state Assembly.

Schubert gave up her Republican affiliation four years ago to run as an independent. Schubert has portrayed herself as a tough-on-crime career prosecutor but is both openly gay and pro-choice, leaving her difficult to pigeonhole on social issues.

The office of California attorney general has long provided both a national stage and a stepping stone to higher office, including recently for Vice President Kamala Harris, U.S. Health and Human Services Secretary Xavier Becerra and former Gov. Jerry Brown.

Becerra used the office to fight then-President Donald Trump at every turn, while Bonta has championed reproductive and LTGBQ rights and the state’s gun control efforts at the national level.

Bonta is running his first statewide campaign after Newsom appointed the former state assemblyman to the post last year.

The radio ads and mailers portrayed Early as the true conservative choice to Bonta. Dan Newman, spokesman for one of the groups promoting Early, criticized the other candidates “who refuse to take positions or reveal their party preference.”

No unaffiliated candidate has ever won statewide office, illustrating Schubert’s uphill climb.

MORE NEWS: Gov. Newsom, California Lawmakers Near Deal On Gas Tax Rebate

Most recently, Steve Poizner was elected state insurance commissioner in 2006 as a Republican, but lost to Democrat Ricardo Lara by nearly 6 percentage points when Poizner ran for the same post again in 2018 as an independent.