Ms. Wahab was widely seen as the front-runner to represent California’s 14th Congressional District, after she won the June primary for the race with 43 percent of the vote. But this week’s election results were far tighter, and the race was too close to call for two days as local officials continued to count ballots until Thursday.
In the closing days of the race, several super PACs — including two with ties to the American Israel Public Affairs Committee — spent millions on advertisements on television and social media targeting the district’s voters in the suburbs east of San Francisco.
United Democracy Project, AIPAC’s super PAC, spent roughly $2.5 million, primarily denouncing Ms. Wahab.
Neither candidate had made foreign policy central to their campaign. But the race became the latest in a string of Democratic primaries that pitted candidates from the more progressive faction of the party against those from the establishment wings in a kind of proxy battle over Israel.
This month, Dr. Abdul El-Sayed won the Democratic Senate primary in Michigan after AIPAC spent $32 million in an attempt to defeat him. Dr. El-Sayed won in part by making criticism of the group central to his campaign. Ms. Wahab’s victory is another sign of the committee’s weakened influence in Democratic primaries, even through its constant heavy spending.
Another super PAC that spent nearly $300,000 to support Ms. Wahab was specifically created to counter AIPAC money.
Ms. Wahab, 39, was the first Muslim and Afghan American elected to the California State Senate. When a moderator asked her during a candidate forum in April whether she considered “what is happening to the Palestinian people a genocide,” Ms. Wahab answered “yes.”
Ms. Hernandez, 51, responded to the yes-or-no question by saying that she believed Israel had the right to defend itself after the deadly Hamas-led attacks on Oct. 7, 2023, before adding that “the destruction in Gaza has gone too far.”
This month, Ms. Wahab said she was more qualified “on every single credential” and suggested she was being targeted because of her ethnic and religious background.
“At the end of the day, all I can say is that it’s based on prejudice and racism,” she said in an interview with Politico.