The California Republican Party will meet this weekend for its annual convention in San Diego. On the surface, the party is not in good shape.

Democrats hold all statewide offices. Pundits have — until recently — predicted that the elections for governor and for U.S. Senate would have all-Democrat finals. Former Insurance Commissioner Steve Poizner reportedly leads the race for his old job, yet this time he is not running as a Republican, but rather as an independent.

In addition, Democrats are targeting half of California’s 14 Republican-held congressional seats in the midterm elections. These are districts where Hillary Clinton won a majority of the vote in 2016. Some of the Republican incumbents decided to retire rather than face tough fights. And the Democrats have the momentum of the so-called “Resistance” behind them, boosted by big donors and buoyed by favorable coverage in the mainstream media.

But Republicans are also seeing a surge.

The “#metoo” movement has forced several Democratic state legislators to resign due to accusations of inappropriate sexual behavior, ending the party supermajority in the State Assembly.

Moreover, the 12-cent gas tax increase Democrats passed last year has led to a backlash. One Democrat State Senator who voted for it faces a recall election, and Republicans are putting a repeal referendum on the ballot.

Even more significantly, the growing revolt against the state’s “sanctuary” laws has energized conservatives over the past two months.

In March, U.S. Attorney General Jeff Sessions traveled to the state as the Department of Justice filed a lawsuit challenging three of the state’s new laws defying federal immigration authorities. That inspired over a dozen local governments, including three counties, to declare their support for the lawsuit and defiance of the state.

As a result, individual Republican candidates are seeing a boost in their poll numbers.

Republican businessman John Cox and Assemblyman Travis Allen (R-Huntington Beach) are now in a close race with former Los Angeles mayor Antonio Villaraigosa for second place in the race for governor, behind frontrunner Lt. Gov. Gavin Newsom. Republican James Bradley is rising in the Senate race and has a chance of qualifying for the November ballot.

If any Republican can qualify for the general election in a statewide race — still a tough task, given that Villaraigosa has millions of dollars still to spend in the governor’s race, and billionaire Tom Steyer is backing State Sen. Kevin de Léon (D-Los Angeles) in the Senate race — that will boost Republican turnout in November.

That, in turn, will help the party minimize its losses. If the locals can hold enough seats, the national GOP may retain the U.S. House.

There are even a few pickup opportunities. One such is Kimberlin Brown Pelzer, a Hollywood actress running in the 36th congressional district (D+2) against Rep. Raul Ruiz (D-CA), a clone of House Minority Leader Nancy Pelosi (who insists she will be Speaker of the House if Democrats win in November).

In other races, the sheer number of Democrats running in the June 5th primary could transform winnable seats into all-Republican finals.

Rep. Dana Rohrabacher (R-CA), who has done as much as anyone to bring the sanctuary state issue to the fore — including offering to pay the legal costs for the city of Fountain Valley to join the federal government’s lawsuit against the state — was once considered one of the five most vulnerable incumbents in the House. But the veteran conservative, known for his iconoclastic views on relations with Russia and legal marijuana, is feeling confident.

One reason is that so many Democrats entered the race against Rohrabacher in the 48th congressional district that they risk splitting the vote between them. Even with a well-known fellow Republican, former Assemblyman Scott Baugh, entering the race, Rohrabacher is looking stronger than ever.

There is even a chance that Rohrabacher and Baugh shut Democrats out of the general election. Democrats are now pressuring each other to quit the race.

The task for California Republicans will be to put differences aside — especially the old Trump vs. Never Trump fight — and unite for the sake of the party and the nation. Democrats need 23 seats nationwide to flip the House, bringing Pelosi to power and certain impeachment for President Trump.

If California Republicans can hold the line, they can, arguably, save the nation. The state party may have seen better days, but never a more important election.

Joel B. Pollak is Senior Editor-at-Large at Breitbart News. He was named to Forward’s 50 “most influential” Jews in 2017. He is the co-author of How Trump Won: The Inside Story of a Revolution, which is available from Regnery. Follow him on Twitter at @joelpollak.