Hillary Clinton got what she needed in New York, a solid victory that stopped Bernie Sanders’s weeks-long winning streak. But any cause for celebration among her supporters probably will be tempered by the reality that her unexpectedly difficult nomination battle has taken a significant toll on her candidacy.

By the end of next week’s contests in Pennsylvania, Maryland, Connecticut, Rhode Island and Delaware, her lead in pledged delegates in all likelihood will be insurmountable. For Sanders, there seemingly will be no path to the nomination other than the unlikely strategy of trying to persuade superdelegates to go against the will of Democratic voters.

By the beginning of May, Clinton will be at liberty to turn her attention to the general election. At that point, turning around public perceptions will be crucial if she hopes not just to win the presidency but to be able to rally the country behind her agenda.

The good news for Clinton — and Democrats will seize on this — is that, against either Donald Trump or Ted Cruz in a possible general election matchup, she looks strong. That’s especially the case against Trump, who continues to run up negative numbers unheard of for a potential major-party nominee. But Trump’s problems do not diminish the fact that, standing alone, Clinton looks much weaker than recent nominees.

Republicans must be gnashing their teeth over the fact that their two leading candidates are unpopular while the candidates with the third- and fourth-most delegates — Sen. Marco Rubio of Florida, who suspended his campaign in March, and Ohio Gov. John Kasich, who hopes for a miracle at the GOP convention — would be far stronger against Clinton.

Vermont Sen. Bernie Sanders. (Ricky Carioti/The Washington Post)

The damage to Clinton from her battle with Sanders is borne out in the latest NBC News-Wall Street Journal poll. The longer this race has gone on, the more she has shown vulnerabilities. The top-line number that caught the eyes of so many analysts shows her now in a dead heat with Sanders nationally — ahead of him by just two percentage points, 50 to 48 percent.

Those numbers have no influence on the state-by-state results but offer a window into both the success of Sanders in generating enthusiasm and Clinton’s inability to capitalize on all her political advantages. Since October, when her candidacy began rising again after several months of controversy about her use of a private email server, she has been on a downward slide. Her lead over the senator from Vermont has dropped from what was then a 31-point advantage to the current two points.

Meanwhile, her negative ratings have been rising and now outweigh her positives by 24 points, according to the NBC-Wall Street Journal poll. That makes her seen no more favorably than Cruz is. Her only salvation is that Trump’s net negative is minus 41. Sanders, meanwhile, has a net positive of nine points — although it’s fair to say that one reason for that is that he has received far less in the way of attacks from Republicans or scrutiny from the media than Clinton has.

Clinton’s image is at or near record lows among major demographic groups. Among men, she is at minus 40. Among women, she is at minus nine. Among whites, she is at minus 39. Among white women, she is at minus 25. Among white men, she is 17 positive, 72 negative. Her favorability among whites at this point in the election cycle is worse than President Obama’s ever has been, according to Bill McInturff, a Republican pollster who conducted the NBC-Wall Street Journal poll with Democratic pollster Peter Hart.

Minority voters have been the linchpin of Clinton’s nomination strategy and were a key to her success in New York. Among African Americans nationally, the NBC-Wall Street Journal poll shows her with a net positive of 51 points. But that’s down 13 points from her first-quarter average and is about at her lowest ever. Among Latinos, her net positive is just two points, down from plus 21 points during the first quarter.

Voters’ perceptions of her having the knowledge and experience to be president remain strongly positive and unchanged since last fall. On other measures, such as whether she is easygoing and likable, or “shares your position on issues,” or is able to bring real change to the country, or is honest and straightforward, she has seen her standing erode since last fall and even more when compared with her first presidential campaign, in 2008.

“By any conventional standard, this is a candidate who’s been disqualified to be president [by the voters],” McInturff said. “Her terrible numbers for months have been masked because we have the one candidate in modern history who has worse numbers. The spectacle of Donald Trump has gotten so much attention that she’s slipped under the radar for what ought to be a real story. . . . Her numbers have gone from terrible to historic and disqualifying.”

1 of 33 Full Screen Autoplay Close Skip Ad × What it looks like on the ground in New York for the primary election View Photos New York voters head to the polls for the Republican and Democratic presidential primaries. Caption New York voters headed to the polls Tuesday for the Republican and Democratic presidential primaries. April 19, 2016 After winning the New York primary, Hillary Clinton speaks to a packed room of supporters during the victory party at the Sheraton Hotel in midtown Manhattan. Melina Mara/The Washington Post Buy Photo Wait 1 second to continue.

Democrats see Sanders as an agent in Clinton’s decline, arguing that in recent weeks his attacks have been aimed less at policy differences and more at questions about her character. Sanders has attacked Clinton as being too cozy with Wall Street, too dependent on big money and for not releasing transcripts of her paid speeches to Goldman Sachs.

“It’s hard to dispute the rising negatives,” said Democratic pollster Stan Greenberg. “I was actually surprised when Sanders began not just to make that personal but appeared to be producing enduring damage.”

Geoff Garin, a Democratic pollster who is working with Priorities USA, a pro-Clinton super PAC, said the primaries have reinforced perceptions of the former secretary of state as “strong, smart and resilient” and as a candidate with a policy agenda far more in tune with the electorate than what Republicans are offering. But he also said that Sanders’s attacks have “reinforced stereotypes that are untrue but challenging nonetheless” for Clinton.

Other candidates have come out of tough nominating contests badly bruised, including Clinton’s husband, former president Bill Clinton, in 1992. He was successful, through a major effort by his campaign, in turning around his image in the time between the end of the primaries in early June of that year and the end of his convention later in the summer.

Republicans believe that Clinton is so well known that she will have difficulty changing minds. “She is substantially weaker as a candidate than I expected and substantially less able to create a compelling persona on the stump,” said Whit Ayres, who was Rubio’s campaign pollster.

Greenberg said there certainly was more room for Bill Clinton to get a second look from voters because he was newer to the national stage. But Greenberg noted that Hillary Clinton has been able to rebound in the past and said she can do so again. “I don’t think there’s the same degree of freedom [as her husband had], but there’s room to improve,” he said. “And I wouldn’t overlook this broad base [of voters] that wants to vote for a Democrat and doesn’t want to vote for a Trump or Cruz.”

Garin added, “I think people are making a mistake if they believe that the numbers you see today inevitably are going to define her standing two or three months from now. Things are not nearly as etched in stone as one would think.”

It is doubtful Clinton imagined a year ago, as she was making early trips to Iowa and New Hampshire, that the nominating contest would be as competitive and bruising as it has turned out to be. She may be lucky in her potential general election opponent, but she has work to do to get ready for what lies ahead.