Hillary Clinton can breathe a sigh of relief. With only a handful of precincts reporting, she was projected the winner of the New York Democratic primary Tuesday night.

 “The race for the Democratic nomination is in the home stretch and our goal is in sight,” she said to cheers.

The win is an important one for the former secretary of state, as it puts a stop to her rival Vermont Sen. Bernie Sanders’ seven-state winning streak and shows that she can still win in big states with diverse populations. While she led in New York polls for months leading up to the primary and was expected to win Tuesday, the result came as a particularly heavy blow to Sanders, who outspent Clinton by a 2-to-1 margin in New York, NBC News reported.

Sanders spent $5.6 million on ads in the Empire State, while Clinton spent just $2.8 million. On top of traditional ads blanketing the airwaves, the Sanders campaign also spent money on media targeting millennials, who have made up a significant portion of his devoted fanbase. On primary day in New York, the Sanders campaign bought Snapchat geofilters that encouraged app users to get out the vote and support the Vermont senator.

Sanders has been outspending Clinton for a while now, bolstered by his seemingly endless stream of small-dollar donations. While Clinton began the campaign by raising huge amounts of money and has been helped by large super PACs, the enthusiasm around Sanders’ campaign has seen him raise more money than her for the past three months.

Before this most recent round of campaigning, Sanders also outspent Clinton in Wisconsin and spent $3.4 million on ads in Arizona, Idaho and Utah, which voted near the end of March. In those contests, Clinton spent just $600,000 in Arizona, NBC News reported.

Sanders lost Arizona but won the other states. His victories, however, haven't been enough to catch up to Clinton, who came in first in larger states with more delegates. The New York primary Tuesday is expected to put her farther ahead in the pledged delegate count.

Sanders’ big spending also means that he's burned through a lot of his cash. So while the Vermont senator has brought in more money than Clinton recently, the Sanders campaign had just $17.2 million in cash on hand, compared to Clinton’s $30.8 million last month.  

Sanders' campaign has repeatedly said it is unconcerned with the delegate math and has been counting on the momentum it’s gained from recent wins to carry it forward and make him competitive in states like California. Leading into New York, that momentum brought Sanders lots of donations and huge turnout numbers at rallies across the state but weren't enough to secure a first place finish.

Ahill22 Democratic presidential candidate Hillary Clinton arrives onstage at her New York presidential primary night rally in New York City, April 19, 2016. Photo: Mike Segar/Reuters

Clinton and Sanders each spent significant campaign time in New York attacking each other’s records and qualifications. Both also leaned heavily on celebrity surrogates. Clinton often held events with prominent black and Hispanic leaders in New York City, as well as New York Mayor Bill de Blasio, while Sanders made use of actors like Mark Ruffalo, Rosario Dawson and Shailene Woodley and even featured the band Vampire Weekend at a rally in Manhattan last week.

Sanders has typically done best in states that hold caucuses and in places with little ethnic diversity. That means the next round of primary contests in Rhode Island, Maryland and Delaware are likely to be more difficult for Sanders while Clinton has been leading in the polls. FiveThirtyEight pointed out that Sanders would need to win an unusually large majority of the vote in remaining contests to catch up to Clinton in the delegate count.