(CNN) Democrats breathed a sigh of relief on Wednesday, as they appeared poised to avoid the nightmare scenario they feared in California — where they could have been locked out of competing in several key congressional races in November.

There are still tens of thousands of ballots to be counted in three of the most closely watched races in the country: California-39, California-48 and California-49. Because of the slender margins and the complications of California's "top two primary" -- where the two highest vote-getters advance to November, regardless of party -- the number two candidate was still unclear in two of those races.

Several of the Democratic candidates refused to concede in those districts, which are held by Republicans but were won by Hillary Clinton in 2016 and are key to Democratic hopes of notching the 23 seats that they need to win back the House.

There is still a possibility that Democrats could be boxed out of competing in California-48, the coastal Orange County district represented by Congressman Dana Rohrabacher.

Rohrabacher easily secured a spot to compete in November. But Democrats Harley Rouda, a real estate businessman, and Hans Keirstead, a neuroscientist, were separated by 73 votes, at 17.3% and 17.2% respectively. Republican Scott Baugh, the former Orange County GOP chair, was about 1,100 votes behind Keirstead.

The Orange County registrar reported Wednesday morning that there were still 188,488 ballots to count -- a trove of ballots that could affect all three Congressional races.

Rouda initially claimed victory in a statement, but the count is continuing. On Twitter, Keirstead said that "an overwhelming majority of #CA48 voters came together yesterday to #FireDana. Flipping the 48th is finally within our reach—let's make sure every lawful vote is counted & get to work to defeat @DanaRohrabacher."

CNN has projected that one Democrat will advance in California's 49th District, where Rep. Darrell Issa is retiring, avoiding a shutout for the party. Republican Diane Harkey, who was endorsed by Issa, cleared the top spot.

Mike Levin, an attorney who is the former executive director of the Orange County Democratic Party, is leading in early returns. His closest contender, former state department contractor Sara Jacobs, maintained that she is still in contention for second place as the count continues.

In a statement Wednesday, Jacobs noted that election officials in Orange and San Diego counties have said there are still tens of thousands of ballots to be counted.

"I feel, and I'm sure everyone agrees, that it's important that every vote be counted and we're going to allow that process to continue," Jacobs said.

In California's 39th Congressional District, which includes parts of Orange, Los Angeles and San Bernardino counties, CNN projects that former California State Assemblywoman Young Kim and Democrat Gil Cisneros, who was endorsed by the Democratic Congressional Campaign Committee, will advance to the November contest.

In California's 25th district, represented by Steve Knight, CNN projects that Democrat Katie Hill will face the incumbent.

There may be a higher number of provisional ballots to count in CA-39 and CA-25, because of a printing error in Los Angeles County that left 118,000 voters off the roster on Election Day.

Republicans, however, had a good night in California, because their leading candidate for Governor, John Cox, made it on the November ballot where he will face off against Lt. Gov. Gavin Newsom, who easily finished first.

If they had been shut out of the governor's race in November, Republicans worried that would depress GOP turnout statewide -- making it much easier for Democrats to pick off their most vulnerable incumbents.

The Republican share of the electorate has been shrinking for decades in California, and the GOP does not hold any statewide offices. So until President Donald Trump began tweeting in support of Cox, Republicans had feared that Newsom might end up in the November contest with Democrat Antonio Villaraigosa, but the former Los Angeles mayor fell far short and conceded defeat.

Veteran California Sen. Dianne Feinstein cruised to the November ballot with strong support from Democrats. CNN projects that her upstart challenger, state Sen. Kevin de León, will face her on the November ballot, after he narrowly avoided defeat by a virtually unknown Republican for the second spot.

De León has argued that he represents a more progressive wing of the Democratic Party than Feinstein, but he has gained little traction in his quest to unseat her -- even though his support from California delegates deprived her of the Democratic Party endorsement earlier this year.

Feinstein remains enormously popular among Democrats, in part because of her untiring battle for additional gun control measures including an assault weapons ban. Because of her dogged leadership on the Senate Intelligence and Judiciary committees, she has also won the respect of moderates and independents over the years, which has widened her margins of support.

De León is little known beyond his Los Angeles district, and has never run statewide. He struggled to raise money even from allies who had supported him at the Statehouse, in part because of the reverence for Feinstein and because many Democrats did not want to lose her seniority in the Senate.

"This nation was built on the promise that anyone willing to risk it all to come here -- regardless of who they are or where they came from -- could have a fair shot at a hard day's work, afford a roof over their head, affordable health care, and an equal opportunity to succeed. It's time Californians had a United States senator committed to making good on that promise," de León said.

"Voters deserve a spirited debate in the coming months on the issues they care about most and the challenges facing our state. I look forward to engaging my opponent on the debate stage as we face off in November."

Alabama, Iowa, Mississippi, Montana, New Jersey, New Mexico and South Dakota also had primary races Tuesday.

In Montana, State Auditor Matt Rosendale will win the GOP Senate primary, CNN projects, and will face incumbent Democratic Sen. Jon Tester, who is running for a third term in a state Trump won in 2016.

In Alabama, Republican Rep. Martha Roby will face a July runoff to save her seat after failing to top 50% in Tuesday's primary. Roby will face Bobby Bright -- a former Democratic congressman who is now running as a Republican. Roby fell short of 50% in part because she is paying a price in deep-red Alabama for saying in 2016 that she would not vote for Trump.

In South Dakota, Rep. Kristi Noem won the Republican primary for governor against Attorney General Marty Jackley. If Noem wins in November, she'd be the state's first female governor.

In Iowa, Democrat Fred Hubbell won his primary to face Republican Gov. Kim Reynolds. Two women in Iowa advanced to the general election on Tuesday. In Iowa's 3rd Congressional District, small-business owner Cindy Axne and in Iowa's 1st District, State Representative Abby Finkenauer, won their Democratic primaries to face incumbent Republicans in the fall.