US President Donald Trump has endorsed a former top adviser to ex-British PM David Cameron for governor of California, shaking up an unusually unpredictable race in the heavily Democratic state.

In a Truth Social post, Trump declared Republican candidate Steve Hilton would be a great governor. The president argued that Democrats have done an absolutely horrendous job in California and that people are fleeing the state.

Hilton is one of 10 total candidates running in the June 2 primary. The top-two finishers, regardless of party, will advance to the general election.

Republicans have not won a statewide election in California in two decades.

Hilton posted on X on Monday that he was deeply honored to receive the Republican president's endorsement. However, Trump's backing could become a hindrance if Hilton faces a Democrat in November's election in the liberal-leaning state.

Hilton, who now lives in California, previously served as a top aide to Cameron from 2010–12, but later grew critical of the Conservative prime minister's immigration policy.

He is running for governor on a platform of lower taxes and cutting back the state budget, while helping lower housing and other costs for families.

Democrats dominate California state politics, but Republicans viewed this as a rare chance to capture the governor's mansion because of a splintered Democratic field of candidates in the state's so-called jungle primary system.

Trump's endorsement of Hilton may squeeze out the other Republican in the race, Riverside County Sheriff Chad Bianco, leaving the door open for a Democrat to secure a top spot.

A March poll by the University of California, Berkeley's Institute of Governmental Studies suggested Hilton and Bianco were ahead of the Democratic contenders, alarming the Democratic establishment.