Voters have been saying for months that they don’t like their choices for president this year. Now, the campaign for the White House turns in large part on whether they reward the Democratic Party for giving them a new option.

The Trump campaign had built its strategy around President Biden as its opponent and hoped that the incumbent, his political standing deteriorating, would remain in the race. But the campaign and its allies pivoted as Biden ended his candidacy and Vice President Kamala Harris quickly won broad support among Democratic officials to replace him, emerging on Monday as the near-inevitable nominee.

On Sunday, Trump allies posted an ad attacking her immediately after Biden withdrew from the race. On Monday, Trump’s newly announced running mate, Sen. JD Vance of Ohio, used his first solo campaign appearance to accuse Harris of masking Biden’s compromised health condition and Democrats of undermining democracy by pushing Biden from the race after he had easily swept through the party’s primary elections.

The main super political-action committee supporting former President Donald Trump, MAGA Inc., said it would spend $11 million in the next two weeks on the anti-Harris ad, which attempts to transfer Biden’s low approval ratings on inflation and immigration onto Harris. The ad, which began appearing Sunday evening on broadcast TV in the swing states of Pennsylvania, Arizona and Georgia, also says Harris helped mask Biden’s “obvious mental decline.”

Trump took to social media Sunday evening to complain about the curveball Democrats had thrown. “So, we are forced to spend time and money on fighting Crooked Joe Biden, he polls badly after having a terrible debate and quits the race. Now we have to start all over again,” he wrote.

Among Democrats, a day of continued endorsements from the party’s leading figures and several labor unions culminated in Harris on Monday evening securing the pledged support of a majority of delegates to the party’s national convention, an Associated Press tally found, all but assuring her the nomination. In a capstone endorsement, former House Speaker Nancy Pelosi said on Monday that she supported Harris, following other senior party leaders, among them former President Bill Clinton and 2016 presidential nominee Hillary Clinton.

Harris’s fledgling campaign announced that it had raised a formidable $81 million in 24 hours in donations to the campaign, the party and related committees. The sum suggested that Democrats, many of them depressed by Biden’s declining prospects as a candidate, felt new optimism about the election.

Any new nominee gives Democrats a chance to shed the liability of Biden’s age and declining mental acuity, which was on display as the 81-year-old president suffered cognitive lapses during his debate against Trump last month. Harris, 59, presents a very different contrast with Trump, 78, than did Biden.

Biden’s withdrawal also strengthens his party’s ability to shift the spotlight from the president’s weaknesses and refocus voter attention on Trump’s role in overturning Roe v. Wade (he installed a solid conservative majority on the Supreme Court that eliminated the constitutional right to an abortion), his recent criminal conviction, his attempts to retain power after the 2020 election and record of breaking democratic norms—issues the party believes voters will reject if their nominee can make them salient.

“Biden’s advanced age and diminished abilities were the blinders that didn’t allow voters to focus on the Democrats’ record of accomplishments and the depraved MAGA Republican platform Trump is offering,” said Fernand Amandi, a Florida-based Democratic pollster.

With Harris apparently amassing the delegates needed to win the nomination, attention turned to her selection of a running mate. The pick could alter voter perceptions of their choice between Harris and the GOP ticket of Trump and Vance. Possible ticket mates for Harris include Govs. Andy Beshear of Kentucky, Roy Cooper of North Carolina and Josh Shapiro of Pennsylvania, as well as Arizona Sen. Mark Kelly.

Both parties will now try to reintroduce Harris to the public. The daughter of Indian and Jamaican immigrants, she is the country’s first Black vice president and the first of South Asian descent. Democrats hope she will revive support from Black, Latino and young voters who normally lean Democratic but weren’t committing to Biden as strongly as in 2020.

At the same time, voters in recent polling didn’t hold a more positive view of Harris than they did of Biden, who has drawn the lowest job-approval ratings of any president at this point in his tenure dating to Dwight D. Eisenhower, Gallup polling has found. In a Wall Street Journal survey this month, both Harris and Biden were viewed favorably by about 35% of voters and unfavorably by about 56%.

Chuck Rocha, a veteran Democratic strategist and pollster, said Harris would be the party’s best choice of nominee because of her biography and ability to inherit Biden’s campaign cash and infrastructure, both of which would be difficult to transfer to another candidate. “The historic value of her nomination—the first woman of color, the first Asian—in our party, that means a lot,’’ he said.

More broadly, he said, the party now gets “a new burst of energy. Since the debate, it has been the life bleeding out of our party.’’ Harris, he said, “puts us back in the game.”

Trump’s allies had already started looking at Harris’s record as a prosecutor—she was California’s attorney general for six years—for material to be used against her. The Trump campaign was preparing ads focused on her, according to a person familiar with the planning, and aides were highlighting some of her older positions.

If a challenger to Harris of significant stature emerged, and the party allowed an open competition for delegates, the result could be the first time a party entered its convention without knowing its nominee in advance since 1976, when then-President Gerald Ford bested Ronald Reagan in securing the final delegates he needed at the Republican nominating conference that year.

Several prominent Democrats said Sunday they would back Harris, including Biden, former President Bill Clinton and Hillary Clinton, the 2016 Democratic nominee. Notably, former President Barack Obama issued a statement praising Biden but without endorsing Harris, and the Democratic House and Senate leaders didn’t weigh in on a replacement for Biden.

Trump’s campaign said Monday that he “fired” Biden at the debate and that he would do the same to “dangerously liberal” Harris, citing polling showing Trump ahead of her. “The problem for the left and media elite? Kamala Harris is as bad, if not worse, than Joe Biden,” read a memo from senior advisers Chris LaCivita and Susie Wiles, citing her work on immigration and seeking to tie her to the inflation that helped drag down Biden’s popularity.