National Democrats got their preferred candidates in each of New Jersey’s House primaries on Tuesday night, but the very same voters sent a strong rebuke to Sen. Bob Menendez, who barely mustered 60 percent of the vote running against an unknown challenger. The lackluster showing by Menendez, whose federal corruption trial ended in a mistrial last year, shocked Democrats and could create a new headache for the party as they try to win back control of the Senate.

Lisa McCormick, a first-time candidate with no money, no endorsements, and no campaign appearances, captured 38 percent of the primary vote against Menendez, a two-term senator who has raised more than $8 million and had the endorsement of every major Democrat in the state.

To put Menendez’s poor showing in perspective, he did only slightly worse in the general election in 2012, the last time he was on the ballot.

But Menendez has spent much of his time since then battling a federal indictment related to his high-flying friendship with Salomon Melgen, a Florida eye doctor. Last year, jurors heard nine weeks of testimony describing Menendez’s lavish trips with Melgen, who covered the costs for private jets and hotel rooms at the same time the senator was pleading Melgen’s case in a dispute over his overbilling of Medicare. Menendez’s case eventually ended in a mistrial in November. Melgen was later sentenced to 17 years in prison after being found guilty of $73 million in Medicaid fraud.

The government decided not to retry Menendez, but his problems didn’t end there. Earlier this year, the Senate Ethics Committee ordered Menendez to repay the cost of any outstanding gifts and “severely admonished” him for his behavior. New Jersey Democrats rallied to his side, and despite faltering in public polls, his only challenger was the unknown McCormick.

Menendez will now limp into the general election against Bob Hugin, a former pharmaceutical executive who won the Republican nomination on Tuesday by roughly 50 points. Hugin had the backing of much of the GOP in that race, in part because his personal fortune means he can self-finance a campaign that—until now—was not considered competitive. Hugin has already given his campaign more than $7 million, and is expected to keep investing in the race now that Menendez looks wobbly.

Menendez, a member of the Senate Finance Committee and former chairman of the Democratic Senate Campaign Committee, has never struggled with fundraising, though it’s unclear whether he can match Hugin’s spending. If the national party is forced to shore up Menendez in New Jersey—one of the most expensive media markets in the country—the race could become a sinkhole for money that the party would prefer to spend almost anywhere else.

Hugin, for his part, has already signaled he will run an aggressive campaign, and he had spent $2 million attacking Menendez even before the primary was over, with ads that showed washed-out images of the senator and labeled him a “disgrace.” Hugin’s record has its own blemishes. Last year, while he was still the CEO of Celgene Corp.,* the firm agreed to pay $280 million to settle allegations that it promoted cancer drugs without FDA approval. He will also have to battle accusations that he supports Donald Trump, in a state Trump lost by 13 points. At a White House discussion on drug prices last year, and that he later called the meeting “incredibly encouraging” and branded Trump’s agenda “pro-growth.”

For New Jersey Democrats with a long enough memory, the results on Tuesday will feel disturbingly familiar. In 2002, the state’s incumbent senator, Sen. Robert Torricelli, was forced to drop his re-election bid one month before the general election, after he too was “severely admonished” by the Senate Ethics Committee. Before he dropped out, Torricelli trailed badly in the polls behind a mostly unknown Republican businessman, and his travails threatened to tip the balance in a closely divided Senate.

Correction, June 6, 2018: An earlier version of this post misspelled the name of Hugin’s former company. It is Celgene Corp., not Celegene Corp.