How Bernie Sanders won Wisconsin, in less than 60 seconds (Peter Stevenson/The Washington Post)

Bernie Sanders emerged from Wisconsin with a solid victory Tuesday, prolonging his dogged but improbable bid to catch Hillary Clinton in the fight for the Democratic presidential nomination.

The senator from Vermont was leading the party’s front-runner in a state with a celebrated tradition of progressive activism — and a primary open to independent voters, a bedrock Sanders constituency.

Now, despite Clinton’s still-overwhelming lead in delegates, Sanders can claim the momentum of winning in six of the past seven states holding nominating contests across the country.

The victory was certain to energize Sanders’s supporters two weeks ahead of what will be a key showdown in delegate-rich New York, a state where Clinton hopes to put an end to Sanders’s embarrassing winning streak and reclaim control of the race against the self-described democratic socialist.

Sanders held a boisterous rally Tuesday night in Wyoming, the site of Democratic caucuses Saturday. Screams erupted and the crowd broke into chants of “Bernie! Bernie! Bernie!” in an auditorium at the University of Wyoming in Laramie when Sanders shared the news that the networks had called Wisconsin for him.

“If we wake up the American people, and working people and middle-class people and senior citizens and young people begin to stand up and fight back and come out and vote in large numbers, there is nothing that we cannot accomplish,” he said.

Clinton had already turned her attention to New York before voting began in Wisconsin. She appeared Tuesday morning on ABC’s “The View,” held an event in Brooklyn focused on women’s issues and attended an evening fundraiser in the Bronx where attendees were asked to raise $10,000 for her campaign.

In a tweet after the polls closed, Clinton congratulated Sanders on his victory. “To all the voters and volunteers who poured your hearts into this campaign: Forward!” she wrote.

While catching Clinton in the delegate count remains a long shot, Sanders has chipped away at her onetime lead of more than 300 pledged delegates, which was down to 263 before Tuesday’s contest in Wisconsin, according to an Associated Press tally.

Sanders invested significant time in Wisconsin, not leaving the Badger State in the final four days leading up to the primary and making an unadvertised campaign stop at a Milwaukee diner Tuesday morning.

“If people come out to vote in large numbers, I think we’re going to do very, very well,” Sanders told reporters as he entered Blue’s Egg with Barbara Lawton, a former Wisconsin lieutenant governor.

Sanders aggressively sought to highlight his more insular views on trade — an issue that he’s pressed in other Midwestern industrial states — as well as Clinton’s ties to Wall Street.

Wisconsin was viewed as difficult terrain for Clinton. In 2008, the state’s Democratic electorate was 87 percent white — voters whom Sanders has consistently won in nominating contests this year. Its industrial landscape, large bloc of independent voters and substantial working class also were seen as fertile ground for Sanders’s message of rethinking U.S. trade policy.

In 2008, Clinton lost the state by 17 points — to then-Sen. Barack Obama.

This time, she campaigned lightly here, focusing strategically on cities in congressional districts that played to her strengths, including Milwaukee, where she is popular with a large African American electorate.

She highlighted that she, unlike Sanders, has been a Democrat her “whole adult life.” She emphasized her commitment to supporting Democratic candidates at the state and local levels — a salient issue for a state party that has been waging fierce ideological battles against Gov. Scott Walker (R).

“He’s won some, I’ve won some. But I have 2 1/2 million more votes than he does,” Clinton said on “The View” on Tuesday morning.

Both candidates are now set for a showdown April 19 in New York, a state where Sanders grew up, where Clinton was elected twice to the U.S. Senate — and where 247 delegates will be at stake.

Clinton plans to campaign aggressively there, in part to prevent an embarrassing upset in her adopted home state and in part to deliver a decisive victory that would further marginalize Sanders.

The Brooklyn-born Sanders plans to make New York his home base over the coming two weeks as well. While he will make some campaign stops in other states with upcoming nominating contests, aides say he plans to return to New York City most nights, reflecting the hard-to-overstate consequences of the primary.

His decision to campaign Tuesday in Wyoming was born of a desire to add to his momentum heading into New York by notching a win in the state’s caucuses Saturday, though only 14 delegates are in play.

At this time in 2008, Obama’s pledged-delegate lead over Clinton fluctuated between 120 and 140 delegates — about half of the margin by which Clinton now leads Sanders. And that doesn’t include superdelegates, the elected officials and other party leaders who are not bound by their state’s results and who so far have broken heavily in Clinton’s favor.

Sanders aims to catch Clinton in pledged delegates — those won in primary elections — once California votes June 7. Doing so would require lopsided wins in most of the remaining contests, including some in states that have demographics similar to places where he has struggled.

If Sanders catches Clinton — or gets close — both candidates would enter the party’s convention in July without enough pledged delegates to claim the nomination. That would force the party’s superdelegates — who are automatically made convention delegates — to choose the nominee, a scenario Sanders’s campaign manager reiterated during an interview Tuesday on CNN.

The Sanders campaign has started making the case to superdelegates that they should side with him because he is more electable than Clinton against Republican front-runner Donald Trump — a view the Clinton camp disputes.

In a memo to supporters Monday, Clinton’s campaign manager, Robby Mook, described the Sanders strategy as reliant on “overturning the will of the voters.”

The results in Wisconsin continued many of the trends seen in previous contests.

Independents, who were allowed to participate in the Democratic primary, favored Sanders over Clinton by a 40-point margin, according to preliminary exit polls. And as in prior contests, voters rated Sanders as far more trustworthy than Clinton. Nine in 10 Democratic voters said Sanders was “honest and trustworthy,” compared with to 6 in 10 who said the same of Clinton.

Tuesday morning, as Sanders mingled with voters over breakfast at Blue’s Egg in Milwaukee, Dale Dulberger, 66, of Wauwatosa, Wis., came to greet the senator after casting his vote for him.

“I think he’s really authentic,” Dulberger, who teaches at a county technical college, said of Sanders. “I think people believe what he’s saying. His proposals are idealistic, but that’s what a president is supposed to do.”

Clinton, on the other hand, campaigned in New York City and did not mention Wisconsin’s election at either appearance.

In a preview of what is expected to be a rough-and-tumble New York primary, the New York Daily News debuted Wednesday’s front-page story, which encapsulates the challenge that awaits Sanders in the Empire State. The paper lambasted the senator for his position opposing legal liability for gunmakers after the massacre at a Newtown, Conn., elementary school in 2012. The headline: “Bernie’s Sandy Hook shame.”