“I am so, so thrilled and so grateful to all of my supporters out there. Some may have doubted us, but we never doubted each other. And this one is for you,” she said. “Hotel and casino workers who never wavered, students with too much debt, and small business owners who never go off the clock, tens of thousands of men and women with kids to raise, bills to pay and dreams that won’t die — this is your campaign. And it is a campaign to break down every barrier that holds you back.”

But Saturday’s win was bittersweet for the Clinton campaign and again cast a light on how Mr. Sanders is putting up a much tougher fight than expected.

Less than two months ago, Mrs. Clinton’s lead in Nevada was more than 23 points — underscoring how her strength has evaporated nationally and in key states across the country as Mr. Sanders‘ gains traction, energizes younger voters and articulates a more liberal direction for the country.

Mr. Sanders‘ growing popularity was reflected in the Feb. 1 Iowa caucuses, where the the candidates battled to a virtual tie. One week later in New Hampshire, Mr. Sanders crushed Mrs. Clinton by more than 20 points in the Granite State primary — a stunning defeat that brought back memories of 2008, when Mrs. Clinton’s presumably unstoppable campaign was derailed by then-Sen. Barack Obama.

Mr. Sanders argued Saturday the close contest only verifies his viability going forward and claimed that he, not Mrs. Clinton, has the momentum in the race.

“We have come a very long way in nine months,” he told supporters moments after calling Mrs. Clinton and congratulating her on her victory. “The wind is at our backs. We have the momentum. And I believe that when Democrats assemble in Philadelphia in July at that convention, we are going to see the results of one of the great political upsets in the history of the United States.”

Due to Nevada’s caucus rules, the two candidates will split delegates in the state.

Liberal activists also say that Saturday’s result simply proves that Mrs. Clinton’s aura of inevitability — and the notion that she would annihilate Mr. Sanders in states with large minority populations — has been shattered.

“If anyone bought into the establishment lie about the existence of a firewall in the 2016 Democratic contest, the fact that Sanders nearly erased a 25 point deficit in Nevada in less than a month should end it and three straight positive results prove that Bernie Sanders’s grassroots campaign can win anywhere,” said Charles Chamberlain, executive director of the liberal PAC Democracy for America, which has endorsed Mr. Sanders.

Still, Saturday’s victory gives the Clinton campaign a badly needed shot of momentum heading into next weekend’s South Carolina primary. Polls show Mrs. Clinton with a lead of more than 20 points in the Palmetto State and a slight lead nationally.

Mr. Sanders indicated Saturday that he won’t even compete in South Carolina. At the conclusion of his concession speech, he said, “It’s on to super Tuesday.”

“On super Tuesday, I believe we have an excellent chance to win many of those states,” he said of the March 1 contests.

Eleven states across the country will hold primary elections on so-called super Tuesday.

Regardless of whether Mr. Sanders decides to fight in South Carolina, it’s clear the race will get uglier moving forward.

Mr. Sanders in recent weeks has questioned Mrs. Clinton’s credentials as a true progressive, taking repeated shots at her close ties to Wall Street and the fact that she raked in more than $600,000 for private speeches to Goldman Sachs.

The Clinton campaign, meanwhile, has tried to paint Mr. Sanders‘ platform as unrealistic. In trying to win voters to her side, Mrs. Clinton has stressed the fact that she and Mr. Sanders share many of the same goals, including health-care coverage for all Americans, debt-free college and many other items high on liberals’ wish lists.

But she’s also said that Mr. Sanders‘ plans are unachievable, while she offers proposals that are grounded in reality and, theoretically, in her view, could become law even with a Republican-controlled Congress.

That line of attack led Mrs. Clinton’s husband, former President Bill Clinton, to say two weeks ago that Mr. Sanders lives inside a “hermetically sealed box” that is fully detached from reality.

Mrs. Clinton lobbed her own criticisms Saturday, saying the Sanders campaign is wrongly focused on just one issue — Wall Street reform.

“The truth is, we aren’t a single issue country. We need more than a plan for the big banks. The middle class needs a raise, and we need more jobs,” Mrs. Clinton said.

Mr. Sanders is winning over younger voters and those looking for a more liberal agenda, while Mrs. Clinton is capturing older, more affluent voters and those who are more interested in experience and continuing President Obama’s course.

Mrs. Clinton also does well with wealthy voters, while Mr. Sanders does much better with voters making under $50,000. Mr. Sanders also is seen as a much more honest and trustworthy candidate, polling has shown, perhaps a reflection on the private email server scandal that has dogged Mrs. Clinton throughout this race.

Moving forward, Mrs. Clinton hopes to use the Nevada caucuses as a springboard to the Democratic nomination. Having held off Mr. Sanders in the West’s first primary contest, Mrs. Clinton was able to avoid the disaster that would’ve come with losing a 20-point lead in less than two months.

“The delegates matter less here than the optics of winning a state where Clinton was ahead and favored to win,” said Brandon Rottinghaus, a political science professor at the University of Houston. He went on to say that Mr. Sanders needed a Nevada win to keep Mrs. Clinton on her heels.

“Without the momentum from a Nevada win, the narrative nationally will turn to Clinton turning the tide and revving up to the delegate race in the south,” he said.