California Democrats on Wednesday were poised to claim slots on nearly every House ballot on the year’s biggest day of primary elections, a major step forward in the party’s pursuit of the majority in November.

In a state heavily antagonistic toward President Trump, Democrats spent millions targeting roughly a half-dozen Republican-held congressional seats that could give them a chunk of the 23 seats they need to flip to gain majority control of the House.

Opposition to Trump and his policies produced scores of candidates, which complicated Democratic efforts in a state with an un­or­tho­dox primary system in which the top two vote-getters advance regardless of party. But by Wednesday morning, it was clear that Democratic candidates would compete in nearly all of the 53 districts.

Absentee ballots and a handful of close races meant that the outcomes of some key contests were still undecided and could remain so for days, if not weeks.

In a boost for the party establishment, Democrat and Navy veteran Gil Cisneros secured a ballot spot in the 39th congressional district, which covers parts of northern Orange County. He will face Republican Young Kim in a district that Hillary Clinton won in 2016.

In the nearby 45th congressional district, Rep. Mimi Walters (R-Calif.) will face Democrat Katie Porter in one of the many woman-vs.-woman contests this election year. Porter was endorsed by Emily’s List and Sen. Elizabeth Warren (D-Mass.).

Trump called the primary election a “great night for Republicans” and touted his influence on the outcomes. “Even Fake News CNN said the Trump impact was really big, much bigger than they ever thought possible. So much for the big Blue Wave, it may be a big Red Wave,” he tweeted Wednesday.

House Majority Leader Kevin McCarthy (R-Calif.) was bullish about the results in his state and suggested Minority Leader Nancy Pelosi (D-Calif.) would be a drag on Democratic candidates in November.

“If I was a Democratic member, I’d be really worried about Nancy continuing to move forward,” McCarthy said.

Pelosi responded with a confident statement praising the “battle-tested and diverse Democrats” who will appear on the ballot in California in November.

“From the heartland of America to the coasts, American voters sent the Republican Majority a powerful message of rejection of the GOP’s relentless efforts to destroy health care and reward the special interests,” Pelosi stated.

“As primary results continue to come in, it is clear that hard-working American families are rejecting the Republicans’ raw deal.”

As voters chose nominees in seven other states in congressional, statewide and local contests on Tuesday, two well-known Democrats prevailed in marquee California races.

Dianne Feinstein, at 84 making another bid for the Senate seat she has held since 1992, won the most votes and will face Democratic State Sen. Kevin de León in the runoff. Gavin Newsom, the state’s lieutenant governor, was projected the winner of the race to succeed the term-limited Gov. Jerry Brown (D) and will face Republican John Cox in November.

Trump praised Cox’s performance. “He can win,” the president tweeted.

Newsom’s primary victory ensures that the general election will focus largely on how the next California governor will relate to Trump and his policies. The president’s endorsement of Cox was widely seen as giving the Republican candidate a bounce late in the primary.

“We’re engaged in an epic battle, and it looks like voters will have a real choice this November between a governor who’s going to stand up to Donald Trump and a foot soldier in his war on California,” Newsom said.

Cox, an accountant who did not support Trump in 2016 but has embraced the president’s backing this year, used his election night speech to blast Newsom for criticizing Trump.

“It wasn’t Donald Trump who made California the highest tax state in the country,” Cox said. “It was Gavin Newsom and the Democrats.”

Feinstein, who in the past has broken with her party on issues that include the death penalty and the Iraq War, has run as the candidate of “California values” and built a huge lead over more than 31 challengers by emphasizing her leadership role and moving to the left on a number of issues.

Both Feinstein and Newsom, representing different generations and clashing styles of the party’s politics, will enter November’s election as clear favorites. But perhaps more attention was directed down the ballot, where Tuesday’s results provided new insight into Democrats’ chances for retaking congressional majorities. In interviews at polling places in California on Tuesday, numerous voters said they had cast their votes strategically with an eye toward November.

James Woeber, 48, a leadership consultant who lives in the San Diego area 49th Congressional District, said he voted for Doug Applegate — a well-known candidate with a military background — over two more liberal Democratic challengers whom he also liked.

“I think he’s got the best chance in November,” Woeber said. “We need that seat.”

Final results may not be known for days, given the state’s high proportion of mail-in ballots, which must be hand-checked before they are certified — a time-consuming process.

A further complication emerged Tuesday evening when election officials in Los Angeles County announced that a “printing error” left more than 100,000 voters off the rolls, forcing them to cast provisional ballots — if they voted at all.

In Alabama, GOP voters delivered a rebuke to incumbent Rep. Martha Roby after she angered constituents by un-endorsing Donald Trump during the presidential race after the 2016 release of the “Access Hollywood” tape in which Trump bragged about groping women.

Roby is headed for a runoff against former congressman Bobby Bright, whom she defeated in 2010 when Bright held office as a Democrat. In TV ads, Bright, who switched to the Republican Party after that defeat, accused Roby of “[turning] her back on President Trump when he needed her the most.”

In New Jersey, Democrats’ favored candidates easily won House primaries. Well-funded former assistant secretary of state Tom Malinowski emerged from a three-way primary to win the right to challenge 7th Congressional District incumbent Rep. Leonard Lance (R). In the race for the 11th Congressional District seat being vacated by Republican Rodney Frelinghuysen after 24 years in the House, Navy veteran and attorney Mikie Sherrill won an overwhelming victory.

And in the 2nd Congressional District, which is being vacated by retiring GOP congressman Frank A. LoBiondo, Democratic voters nominated Jeff Van Drew, a conservative Democratic legislator whom the party had recruited for years, while Republicans nominated a local politician who had raised just $22,529 and had been ignored by the national party.

New Jersey voters did deliver a wake-up call to Sen. Robert Menendez (D-N.J.), who is running for reelection months after the Justice Department dropped a bribery case against him and the Senate Ethics Committee admonished him for improper dealings with a longtime donor.

Menendez won only 62 percent of the primary vote against Lisa McCormick, a Democratic challenger who raised virtually no money and had not actively campaigned against him. Menendez will face Republican Bob Hugin, a retired pharmaceutical executive who is self-funding his campaign, in November.

In Montana, State Auditor Matt Rosendale was the projected winner of the GOP nomination to take on incumbent Democratic Sen. Jon Tester, in a state that voted overwhelmingly for Trump. Rosendale had been the top choice of national Republican leaders, but some GOP operatives fear the Maryland-born Rosendale could be vulnerable to charges that he is not Montanan enough.

Incumbent Rep. Greg Gianforte (R-Mont.) will face Kathleen Williams, a Democrat, for the state’s at-large House seat.

The New Mexico governor’s race will be a battle of House veterans: Primary voters nominated Democratic Rep. Michelle Lujan Grisham and Republican Rep. Stevan Pearce. Despite Lujan Grisham’s departure, the state’s congressional delegation stands to gain another woman, with female candidates winning both parties’ primaries to replace the two gubernatorial candidates.

Debra Haaland, who won the Democratic primary for Lujan Grisham’s seat, could become the first Native American woman to serve in Congress.

South Dakota Republicans nominated another woman, longtime Rep. Kristi L. Noem, for governor. She will face Democrat Billie Sutton, a state senator who entered politics after he was paralyzed in a rodeo accident.

And in Iowa, Democrats were set to nominate women to challenge two vulnerable incumbent House Republicans. State Rep. Abby Finkenauer will face Rep. Rod Blum in the 1st Congressional District, while business executive Cindy Axne is set to meet Rep. David Young in the Des Moines-area 3rd Congressional District.

The California races could remain unsettled for days as ballots are counted.

In the 49th, the party was encouraged after Republicans rallied around Diane Harkey, a county official endorsed by retiring Rep. Darrell Issa (R). She finished ahead of a trio of Democrats — Applegate, attorney Mike Levin and former Obama administration staffer Sara Jacobs — competing for the second slot.

In the 48th, the Democratic Congressional Campaign Committee has spent more than $1 million to boost businessman Harley Rouda and attack Republican Scott Baugh; the party is hopeful that Rouda can climb over Baugh to make a runoff with Republican Rep. Dana Rohrabacher. The complication in that race: the continuing presence of Democrat Hans Keirstead, a scientist lured into the race by Democrats before they sided with Rouda.

On Wednesday, Rouda occupied the second slot behind Rohrabacher, who received congratulations from Trump. Keirstead ran third and Baugh fourth.

Congratulations to Dana Rohrabacher on his big California win. We are proud of you Dana!” Trump tweeted.

Democrats were more confident about making runoffs in Central Valley races against Republican congressmen David Valadao and Jeff Denham and bullish on two Los Angeles-area districts with Republican incumbents in the seats: the 25th, held by Rep. Steve Knight, and the 45th, held by Walters. TJ Cox, a Democrat, will face Valadao in November.

Tony Perry in Encinitas, Calif., and William Dauber in Huntington Beach, Calif., contributed to this report.