WASHINGTON — Republicans once dominated California. This year, GOP candidates are limping toward the finish line.

Last week, independents surpassed Republicans to become the second-largest bloc of registered voters in the state after Democrats. And after Tuesday's unusual "jungle" primary, the GOP may not have a shot at the governor's mansion and a U.S. Senate seat — something experts say should be a dire warning for the party nationwide.

California's primary system, implemented in 2012, means Republicans are no longer guaranteed a slot on the general election ballot and must compete with Democrats in the primary, where only the top two finishers advance to November, regardless of party. It has caused serious headaches for Democrats. But for Republicans, the problem is existential.

Then-California Governor Arnold Schwarzenegger and his wife, Maria Shriver, wave after the finish of his inauguration ceremony in Sacramento, California, on Nov. 17, 2003. Andy Kuno / EPA

The state's most recent Republican governor, Arnold Schwarzenegger, reaches for cataclysmic language when describing the state of his party.

"Today, we are the Titanic after it hit the iceberg, but before the last bit of the ship submerged," he told a group of fellow Republicans this spring.

California's lurch toward a one-party state was not inevitable. However, it offers a test case into what happens when Republicans respond to a diversifying population by doubling-down on their white base, as President Donald Trump has done, instead of try to expand it, as the Republican National Committee called for in its "autopsy report" after the 2012 presidential election.

"Modern California politics has an uncanny knack of prefiguring what happens in the rest of America in about a 15-year timeline," said Ruy Teixeira, a demographer at the Century Foundation and the liberal public policy organization Center for American Progress.

"All signs show that the national Republican Party is handling rapid demographic change exactly how the California Republican Party did," Teixeira added. "They are totally screwing it up."

The Senate struggle

In another era, Sen. Dianne Feinstein, D-Calif., who will turn 85 this month, would face a serious Republican challenge to her attempt to win re-election to a sixth term.

Instead, her biggest threat this year is a fellow Democrat, former state Senate President Kevin de León. And in a state of nearly 40 million people, her 11 Republican challengers are a mix of oddballs, gadflies and earnest but superficial candidates.

Depending on which poll one looks at, the leading GOP contender for the Senate is Roque "Rocky" De La Fuente, an eccentric San Diego businessman who has spent over $1 million on the race, vastly more than $53,000 spent by his closest GOP challenger.

De La Fuente ran for president in 2016, as a Democrat. This year, he's managed to qualify for Senate races in not one, but at least five states: California, Florida, Minnesota, Washington and Wyoming. He's still waiting to hear on Delaware and Vermont, as well.

"I'm the first person in history to go for more than two states for Senate. Nobody has ever thought about it. Nobody has ever read the rules," he told NBC News.

Why those states? "I love Wyoming, I love to ski in Jackson Hole," De La Fuente explained. Plus, the filing fee is only $200, "and you can do it from your house online.”

Roque "Rocky" De La Fuente is running for Senate in multiple states, including California. Matt Volz / AP

But a Stanford University poll released last week found De La Fuente in second place, behind Feinstein and ahead of de Leon, who most observers expect will claim the second spot on the general election ballot Tuesday.

"If I win Tuesday, I might have to rethink my whole strategy," De La Fuente said. "Then I'll really have to focus all my energy on California."

Also in the running: an avowed white supremacist who made headlines after surging in one poll, though analysts now chock that up to a methodological flaw.

Meanwhile, the top Republican in the most recent SurveyUSA poll was James Bradley, a Coast Guard veteran and first-time candidate who lists his cellphone right on his website and says he gets about 50 calls day.

He recently placed his first ad in a few Latino newspapers.

"When I made the choice of registering Republican, I got hammered, even from my own family," said Bradley, who was an independent before jumping in the race. "I think after years of Democratic rule, people just get to a place where they kind of give up."

When the Golden State was red

Republicans held the governor's mansion throughout most of 20th century and sent three of their own with California connections to the White House (Herbert Hoover, Richard Nixon and Ronald Reagan).

California helped set the pace for conservative politics for decades, from the anti-Communist politics of the Nixon era, to the anti-tax revolts of Reagan's, to immigration politics of today.

Long before Trump tapped into white working-class resentment, California voters passed ballot measures in the 1980s and '90s to make English the state’s official language, outlaw affirmative action, severely punish gang members and cut off all public benefits to undocumented immigrants, including health care and education (courts killed that one).

But the backlash to those laws and to Gov. Pete Wilson, the Republican who championed many of them, lead to the GOP’s downfall in the increasingly diverse state, said Larry Gerston, a political scientist who wrote the textbook on California politics.

"In California, we went through that 25 years ago. We're on the other side of it now," said Gerston, who is also an analyst for a local NBC affiliate. "The nation is not yet there, but it's heading this way."

Unlike, say, Mississippi, California is a behemoth, home to more than one-in-eight Americans and the world's fifth-largest economy. And the demographic trends that powered its political realignment may presage what is happening nationwide.

In 1970, whites made up 77 percent of California's population. By 2000, they were below 50 percent. Today, 38 percent of Californians are white, and Latinos are the state's largest ethnic group.

Whites are still a majority of the U.S. population, but a shrinking one. The Census Bureau projects they'll be a minority by 2045.

Of course, not all Californians are left-leaning. The agricultural Central Valley and rural North remain conservative. San Diego is the largest city in the country with a Republican mayor.

Registered Republicans still outnumber Democrats in Orange County, though Hillary Clinton was the first Democrat to win the fabled conservative stronghold since Franklin D. Roosevelt. And reliable voters tend to skew more Republican and whiter than the population as a whole.

Long odds in the governor's race

Republicans’ best hope to get a candidate on the top of the state ticket in November appears to be John Cox, a conservative businessman running for governor with the backing of Trump.

California gubernatorial candidate John Cox speaks during the California Republican Party convention in San Diego on May 5, 2018. Gregory Bull / AP

He's in a three-way standoff Tuesday with two much better-funded and better-known Democrats, Lt. Gov. Gavin Newsom and former Los Angeles Mayor Antonio Villaraigosa, who have outspent him about 18-to-1 in TV ads.

"We're like a PT boat navigating through a couple of battleships," Cox's campaign manager, Tim Rosales, told NBC News. "It's a question of whether it's going to be two Democrats (in November) or if we're going to give voters a real choice."

Anticipating that they might not have any candidates at the top of the ticket, thus depressing turnout, Republicans pushed to get a referendum added to the ballot to repeal the state's gas tax, which they hope will lure GOP voters to the polls.

Newsom is expected to finish first on Tuesday, and has been openly rooting for Cox or another Republican to come in second instead of Villaraigosa, convinced that a GOP candidate presents little threat to him in the general election.

"You know my position, Chuck," Newsom told NBC News’ Chuck Todd, who moderated a recent debate. "A Republican would be ideal."

But Jim Brulte, the chairman of the California Republican Party, dismisses any obituary writing as premature.

Voters are increasingly frustrated with issues like crime, housing costs, homelessness, crumbling infrastructure and under-funded social programs, and they have no one to blame but Democrats, he said.

"The Democrats are in total control," Brulte told NBC News. "Voters get it and that's why you hear the Democrats in California talk about Donald Trump, because they don't want to talk about their own record."

Even some Democrats echo that point, warning their party against hubris.

"Democrats need to be very careful," said Michael Ceraso, a California operative who ran the state for Bernie Sanders' 2016 presidential campaign. "Are we so stubborn as a party to not think the California GOP are incapable of figuring out a message strategy to turn these voters into Republicans?"