California Governor Gavin Newsom has become the second governor in US history to defeat a recall aimed at kicking him out of office early.
The recall contest was crafted by the Democratic governor as part of national battle for his party's values in the face of the coronavirus pandemic and lingering threats from "Trumpism".
The victory cements Newsom as a prominent figure in national Democratic politics and preserves his prospects for a future US run.
It also ensures the nation's most populous state will remain in Democratic control as a laboratory for progressive policies on immigration, climate change, representation and inequality.
A Republican almost certainly would have replaced Newsom had the recall succeeded, bringing a polar opposite political world view, though they would have had to contend with a state Capitol dominated by Democrats.
The recall, which turned on Newsom's approach to the pandemic, mirrored the nation's heated political divide over business closures and mask and vaccine mandates, and both parties will dissect its outcome heading into the 2022 midterm elections.
Republicans had hoped for proof that frustrations over months of pandemic precautions would drive voters away from Democrats. They also searched for evidence that voters were tiring of liberal leadership.
Democrats have controlled every level of government in California for more than a decade, a period marked by a housing crisis and the increasingly damaging effects of climate change.
Republicans won back four USHouse seats last year, success that leaders hoped had indicated revived signs of life.
Millions of votes were left to be counted, including ballots cast on Election Day on Tuesday.
Democrats were more likely to vote early, and Republicans hoped for a strong showing during in-person voting.
"I'm feeling good, as long as we can get out that vote," Newsom said after greeting volunteers in San Francisco hours before polls closed.
The leading Republican candidate is conservative talk show host Larry Elder, who was seeking to become California's first black governor.
Newsom got a final push late on Monday from President Joe Biden, who warned the contest could shape the country's direction on the pandemic, reproductive rights and the battle to slow climate change.
California voters had two questions on Tuesday's ballot: Should Newsom stay in office? And if not, who should replace him? There were 46 replacement candidates to choose from. If voters keep Newsom, the results on the second question are irrelevant.
In recent days, Elder suggested the results of the recall election could be skewed by unspecified "shenanigans," echoing Trump's baseless claims of voting fraud in his 2020 race with Biden.
Newsom said he would accept the election results and urged Elder and others to do the same.
"As an American, I'm ashamed. I'm disgusted by it. Stop. Grow up. These people literally are vandalising our democracy and trust in our institutions," he said.
Australian Associated Press