Kamala Harris, a candidate for the U.S. Senate, thanks supporters who worked a phone bank for her at the California Democratic Party on election day. (Rich Pedroncelli/AP)

Kamala Harris was declared the winner of the Senate primary in California early Wednesday morning, handily beating her competition with 40 percent of the vote with 76 percent of precincts reporting, according to the Associated Press.

Rep. Loretta Sanchez (D) was trailing far behind Harris with 16 percent of the vote, but she was still in second place. If that result holds, it means the two Democratic women would face off against each other in November for the seat of retiring Sen. Barbara Boxer (D). In third place as the early returns were being counted was Duf Sundheim, the former California Republican party chair.

Harris, 51, the state’s attorney general, was easily the top vote-getter among a field of 34 candidates. She bested a field that included a dozen Republicans, whose party struggled to contend for the first open Senate seat in the Golden State in 24 years.

“I am just thrilled. I am a proud daughter of California and I cannot be more proud than I am tonight,” Harris said in San Francisco. “We have run a campaign, and we will continue to run a campaign, that is about fighting for the ideals of our country. We have so many challenges as a country and we are prepared to lead,” she said, citing passing comprehensive immigration reform, combating climate change, reforming the criminal justice system and “eliminating that income divide that is making so many families suffer.”

Sanchez, 56, a 10-term House member, was well behind but still in second place. Under the state’s primary rules, the two candidates with the highest vote totals, regardless of party, advance to the general election.

Rep. Renee Ellmers (R-N.C.) lost her June 7 primary despite being the first member of congress to receive an endorsement from Donald Trump. (Peter Stevenson/The Washington Post)

The two women led in polling during the past year, owing to a significant Democratic registration advantage and a roster of Republicans who lacked statewide name recognition.

Harris and Sanchez each drew national attention and support because each is poised to make history if elected: Harris would be only the second black woman elected to the Senate, and Sanchez would be one of the first Latinas. Catherine Cortez Masto, a Latina Democrat running for the open Nevada seat of Sen. Harry M. Reid (D), also has a shot at winning in November.

In other significant congressional races Tuesday night, Rep. Renee L. Ellmers (R-N.C.), who was endorsed by Donald Trump, lost her bid for reelection Tuesday, becoming the first GOP congressional incumbent to be defeated in 2016.

Rep. George Holding (R-N.C.) beat Ellmers — who was targeted by conservative groups who once backed during her 2010 election in the tea party wave — and Greg Brannon in North Carolina’s 2nd Congressional District, which includes suburban and rural Raleigh.

Holding represents the 13th Congressional District but chose to run in the 2nd District after court-mandated redistricting took effect earlier this year, prompting an incumbent-versus-incumbent showdown.

And in California, several Republican House members who could be endangered in November were on the ballot Tuesday night. California had a surge of last-minute voter registrations — 76 percent of which were Democrats.

U.S. Rep. Loretta Sanchez exits a voting booth in Orange, Calif. Early results showed Sanchez in second place in the U.S. Senate race, and if that holds, she will face Kamala Harris in November. (Ken Steinhardt/Orange County Register via AP)

House Majority Leader Kevin McCarthy, representing the Bakersfield-based 23rd District, spent more than $2.1 million from Jan. 1 to mid-May to strengthen his standing even without a well-funded challenger, running TV and radio ads in the primary’s final days.

The most vulnerable Republican incumbent may be Rep. Steve Knight in the 25th District, which includes northern Los Angeles and Ventura counties. Other House Republicans who may be at risk, but probably less so, are Reps. Jeff Denham and David Valadao, who represent parts of the Central Valley.

Rep. Darrell Issa’s reelection bid is another one to watch — the 49th District includes parts of San Diego and Orange counties. Issa has been a staunch Trump supporter, and there could be blowback from voters that could benefit Democratic challenger Doug Applegate.

In the Senate race, Harris, a native of Oakland and a former San Francisco district attorney, jumped into the race immediately after Boxer announced she was leaving the Senate at the end of her fourth term. She won the endorsement of the California Democratic Party, and two weeks ago Gov. Jerry Brown (D) gave her his blessing. Harris also has been backed by some of the state’s largest labor unions, the Congressional Black Caucus’s PAC and Massachusetts Sen. Elizabeth Warren (D-Mass.).

Sanchez, whose district is based in Orange County, embraced her underdog status in the race, casting Harris as the establishment candidate. She also has sought to make the case that she is the only candidate in the race with congressional experience, which would make her a more effective lawmaker in the upper chamber. Sanchez has the backing of several California House members, the Congressional Hispanic Caucus’s PAC and the Latino Victory Fund.

For the most part, the two women avoided criticizing each other during the primary. That is likely to change as they enter the next phase of the contest.

Harris’s campaign thinks that she has the advantage from having won two statewide races in 2010 and 2014. She also starts the general election with $4.7 million in cash.

Sanchez has $1.3 million in cash, but her campaign is banking on increased support from Latino and Southern California voters who see a chance to capture one of the Senate seats.

The congresswoman, who serves on the Armed Forces and Homeland Security committees, also is hoping to get support from Republicans, who might find her more politically palatable than Harris.

Recent polls, however, have suggested that a significant number of Republican voters say they would not vote for either Democrat.