In a mathematical squeeze to make up ground in the Democratic presidential race, Bernie Sanders is preparing to ratchet up his attacks on Hillary Clinton ahead of a New York showdown that could establish how easily the party can pull itself back together for the general election.

The Empire State’s April 19 primary looms as potentially determinative: A win by Clinton, who is favored, would further narrow Sanders’s path, while a loss in the state she represented as a senator would embarrass her and hand Sanders a rationale to continue campaigning until the final votes are cast in June.

Clinton had a lead of roughly 300 in pledged delegates, but Sanders narrowed the gap Saturday with a sweep of three Western caucuses. In one of the most successful days of his campaign, the senator from Vermont easily won in Alaska, Hawaii and Washington state.

To capitalize on his fresh momentum, Sanders plans an aggressive push in New York, modeled after his come-from-behind victory a few weeks ago in Michigan. He intends to barnstorm the state as if he were running for governor. His advisers, spoiling for a brawl, have commissioned polls to show which contrasts with Clinton — from Wall Street to fracking — could do the most damage to her at home.

“We’ll be the underdog, but being the underdog in New York is not the worst situation in politics,” said Tad Devine, the chief strategist for Sanders. “We’re going to make a real run for it.”

1 of 42 Full Screen Autoplay Close Skip Ad × Highlights from Bernie Sanders’s campaign, in pictures View Photos The senator from Vermont has become Hillary Clinton’s chief rival in the contest for the Democratic presidential nomination. Caption The senator from Vermont is Hillary Clinton’s rival in the contest for the Democratic presidential nomination. June 14, 2016 Bernie Sanders arrives at the Capital Hilton to meet with Hillary Clinton in D.C. Matt McClain/The Washington Post Buy Photo Wait 1 second to continue.

The intensified and scrappy approach by Sanders comes as Clinton is eager to pivot to the general election. Clinton keenly understands the imperative to unite Democrats for the fall campaign and, thinking that the nomination is nearly locked up, wants to spend the spring building bridges to the Sanders wing.

[Here comes the opposition book: Clinton and her allies prepare for Trump]

A potentially ugly primary in New York threatens to derail those efforts. Clinton’s advisers are all but urging Sanders to lay off his attacks.

“We’re going to run to win delegates and run to win the primary,” Clinton campaign chairman John Podesta said in an interview Friday. “We intend to win this thing with a majority of pledged delegates. Senator Sanders is going to have to make up his mind about what he wants to do and what kind of campaign he wants to run.”

Podesta noted that Sanders took a more negative turn in the Midwestern states that voted on March 15 — Illinois, Ohio and Missouri — and lost all three. “It didn’t work,” he said.

Clinton, her aides and her allies in recent weeks have avoided sharply attacking Sanders, wary of saying or doing anything that would make it more difficult to engineer an eventual coming together.

In particular, the Clinton forces have been careful not to be seen as pushing Sanders to quit the race. A group of pro-Clinton senators recently considered writing an open letter to Sanders saying the time had come for him to end his campaign. But when two Clinton allies, Sens. Charles E. Schumer (N.Y.) and Barbara A. Mikulski (Md.), caught wind of the idea, they persuaded their colleagues to nix it, according to two people familiar with the letter.

Assuming that Clinton stays on course to secure the nomination, her team sees wooing the Sanders coalition as a pressing mission, especially young people and independents, to ensure that they don’t sit out the November election altogether. Key would be whether and how soon Clinton wins Sanders’s endorsement — and how enthusiastic he is in giving it. Clinton’s vocal support for then-Sen. Barack Obama following their divisive 2008 primary helped unite Democrats.

Two popular Democrats currently on the sidelines — President Obama and Sen. Elizabeth Warren (Mass.) — could help bring the two sides together. David Axelrod, a former Obama adviser, pointed to a third unifying figure: Donald Trump. He noted that Warren last week fired off a flurry of tweets attacking Trump, which he read as an important signal.

“She was sending a message to Democrats that there are bigger things at stake here,” Axelrod said, adding: “There probably is going to be a very vivid choice in the general election and one that very much unifies Democrats.”

With that in mind, the Clinton team has been trying to foster trust with the Sanders base. Long lines at Arizona polling places last Tuesday led Sanders supporters to speculate online that the Clinton campaign was in cahoots with the Democratic National Committee in creating obstacles for them to vote.

Rather than responding with indignation, Clinton’s campaign counsel, Marc Elias, wrote a post on Reddit — in an online public square for Sanders fans — sharing in their outrage and explaining that the lines were the result of Republican-led voter restrictions in Maricopa County.

“What happened in Arizona is bad for BOTH Senator Sanders and Secretary Clinton, and supporters of both campaigns should come together to make sure this is addressed before November,” Elias wrote. “By the way, if you’re wondering, Secretary Clinton’s got a plan to address this, but I’m really not here to plug my boss!”

Clinton supporter Jay Jacobs likened the courtship of Sanders backers to making Thanksgiving dinner. “You can’t cook a turkey too fast by turning up the heat,” he said. “You’ve got to cook it at the right temperature for the right amount of time, and it’ll come out fine — but you’ve got to do a lot of basting along the way.”

[Sanders says not continuing to run would be ‘outrageously undemocratic’]

Sanders, meanwhile, is hoping for another win in Wisconsin, which holds its primary on April 5. Sanders won two of Wisconsin’s neighboring states — Michigan to the east and Minnesota to the west — and the state’s overwhelmingly white electorate and the progressive, reformist roots of Democrats there should give him an advantage.

“If we’re going to have a serious shot at the nomination, we’re going to have to defeat her in Wisconsin,” Devine said.

Sanders then hopes to slingshot into New York, which will award a whopping 247 delegates — second only to California.

In New York, a diverse and pulsating center of Democratic power which has not hosted a truly competitive presidential primary since the 1980s, Democrats are buzzing with anticipation over the showdown.

“Everybody thinks it’ll be big,” said Hank Sheinkopf, a New York-based strategist and former Clinton adviser. “If the turnout by African Americans is large, Secretary Clinton will win well. If the turnout is not large, she will not win. Is the opportunity with her? Yes. But this is a test. . . . If it’s tight, it means the left is still aggravated against her.”

The Clinton team is readying for a competitive race and is not taking New York for granted.

“If [Sanders] sneaks up on her, then shame on the Clinton campaign,” Axelrod said. “The city is a bastion of progressivism, and there should be pockets of Sanders supporters. . . . But I have to believe that the relationships she’s forged there in the last 15 years mean something.”

Sanders was born and raised in Brooklyn and plans to highlight his “New York values,” Devine said, and the campaign’s ads would have “a good feel for the state.” Sanders also is likely to go after Clinton over her ties to Wall Street, an issue he has raised for several months now, and Devine said the team is testing attacks on other issues, including fracking.

Sanders wants to ban fracking, the practice of pumping water containing chemicals deep underground at high pressures to release oil and natural gas. Clinton, who has ties to the fossil-fuel industry, says she does not support fracking where it is causing environmental damage — or in states like New York, where it is banned — though she has stopped short of opposing the practice outright.

[An explanation of the Clinton-Sanders divide on fracking]

“The basic frame of his whole campaign — the economy’s rigged, the campaign finance system is corrupt — will continue, but there are other issues, as well,” Devine said. “Fracking is something New York state has outlawed, and there’s a big difference between Hillary and Bernie.”

The Clinton team is preemptively crying foul.

“We fully expect him to continue waging a spirited campaign, but it’s disappointing he is preparing a fresh round of attacks to use against Hillary Clinton in her own back yard, rather than focusing on how to stand up against the dangerous rhetoric and ideas coming from the Republican candidates,” Clinton spokesman Brian Fallon said in an email.

Rep. Steve Israel (D-N.Y.), a Clinton backer, sounded a similar note in an email: “Bernie has every right to stay in the race and bring his campaign to New York and fight hard here. But New Yorkers do not want to see him go on the attack against Hillary when Democrats should be focused on the big threat we face from Donald Trump.”

The New York primary, by definition, should draw considerable media attention, but Sanders wants to raise the stakes even higher. His campaign is lobbying the DNC to organize a debate in New York the week before the primary. “We don’t mind being the away team in the Hillary home game in New York,” Devine said.

The Clinton campaign has objected to having a debate in the state, according to Devine. Fallon declined to comment on debate negotiations.

For now, at least, Clinton’s backers are confident that any damage caused by Sanders will not be lasting. “I think this primary is going to make our Democratic nominee even stronger heading into the general election, and I believe Democrats will come together in November,” Sen. Sherrod Brown (Ohio) said in an email.

Asked about bridge building, Devine suggested that such outreach was a ways off.

“I’m not great at reading the tea leaves,” he said. But he added, “I know Podesta has my number, because he’s called it before — and it wasn’t to build bridges, in case you’re wondering.”

Podesta would not characterize his recent conversation with Devine.

“We’re in a contest,” the Clinton chairman said. “We both understand it.”

Anne Gearan and Abby Phillip contributed to this report.