CONCORD, N.H. -- New Hampshire’s Democratic primary voters confirmed Tuesday that they do, in fact, want a self-described democratic socialist as their party’s presidential nominee.

Bernie Sanders, the independent senator from Vermont, had consistently led former Secretary of State Hillary Clinton in polls of the Granite State since last fall, with margins that frequently surpassed 20 percent. On Tuesday, he defeated Clinton handily.

"Together, we have sent the message that will echo from Wall Street to Washington, from Maine to California," Sanders said at his victory party in Concord, New Hampshire. "And that is that the government of our great country belongs to all of the people, and not just a handful of wealthy campaign contributors and their super PACs."

Sanders argued that the Democratic Party will thank him later for inspiring voter enthusiasm, getting a dig in at Donald Trump, who won the GOP primary Tuesday night, in the process.

"Because of a huge voter turnout -- and I say yuuuge -- we won, because we harnessed the energy and the excitement that the Democratic Party will need to succeed in November," he said.

Sanders' win confirms that Democratic voters identify with a message that many in the party establishment have written off as too radical. There’s a slew of policy positions Sanders has advocated for that Clinton won’t touch, like making public college free, boosting the minimum wage to $15 across the country, legalizing marijuana, expanding Social Security benefits, reinstating the firewall between commercial and investment banking activities and enacting single-payer, universal health care. While each of these positions has significant, if not majority support among Democratic voters, taking on all of them at once was considered bold for a serious Democratic primary candidate.

Clinton attempted to dampen Sanders' expected win ahead of Tuesday night, arguing that his popularity shouldn’t come as a surprise since he represents a neighboring state. But it took months for Sanders to catch up to Clinton in New Hampshire in terms of his number of offices and paid organizers on the ground. And Clinton had the support of many of the state’s highest-profile Democrats, including Gov. Maggie Hassan and Sen. Jeanne Shaheen.

Sanders' entrance into the race last spring was met with skepticism from Clinton’s allies, who dismissed his political position as too liberal and extreme to appeal to voters. (They still think he’s too liberal, though they’re not dismissing the threat he poses to Clinton anymore.) Former President Bill Clinton argued that Sanders' worldview isn’t connected with reality, and that many of the desired reforms the senator touts would be impossible to achieve in a Congress controlled by Republicans, as it is now. Hillary Clinton’s backers have consistently painted Sanders' political views as out of touch, and suggested that he sympathizes with socialist and communist leaders.

But those tactics didn’t resonate in New Hampshire. While the state's voters are famously contrarian, they have not, as Mother Jones’ David Corn recently noted, traditionally embraced Democratic insurgent candidates in the same way they have Republican renegades. New Hampshire’s Democratic picks in the last three primaries have been the establishment candidates: Clinton in 2008, John Kerry in 2004 and Al Gore in 2000.

JEWEL SAMAD/AFP/Getty Images Sanders beat out former Secretary of State Hillary Clinton on Tuesday.

The announcement of Sanders’ victory came so quickly -- just moments after the polls closed at 8 p.m. local time -- that the crowd at Sanders’ victory party in Concord was probably only one-tenth full. Still, the shouts were loud when the news was blasted over the speakers and displayed on the television screens off to the side of the gymnasium at the local high school.

Attendees danced to the funk music pumped over the speakers into the chilly room. They waved baby blue Bernie signs and beamed at the news screens. Staffers hugged, some overcome with emotion. They and Sanders' massive army of volunteers put in many months of work to get to this point. And even though every single indicator told them this would be Tuesday night’s result, it still didn’t feel quite real.

“I was doing a lot of canvassing for him,” said Serena Galleshaw, 25, of Somersworth, New Hampshire. “And back in the fall, they were like, ‘Is he electable? Is he electable?’ Now look at where we are tonight.”

Clinton campaigned heavily in New Hampshire, holding dozens of town halls and organizing events throughout the state ahead of Tuesday's primary. But she wasn’t able to pull off a repeat of her 2008 win, in which she came back from consistent polling deficits to defeat then-Sen. Barack Obama of Illinois.

This time around, New Hampshire voters switched allegiances, choosing Sanders and his call for a political revolution that ends income inequality and gets corporate money out of politics. Sanders knew it was a winning message. He criticized Clinton's dependence on Wall Street for speaking fees and campaign dollars repeatedly during last Thursday's final debate before the primary.

Despite his consistent leads in polls heading into Tuesday's primary, Sanders’ campaign didn’t take a win in New Hampshire for granted. They seemed to be gunning for as large a win as possible, outspending Clinton on television advertisements on the state’s airwaves by a 3-to-1 margin. Clinton’s campaign acknowledged that they had been outspent in a fundraising email to supporters Tuesday afternoon with the bracing subject line, “No matter what happens tonight.”

“The Sanders campaign knows how strong this team is -- that's why they went to the extraordinary measure of outspending us on the airwaves 3-to-1 here in New Hampshire,” the email read.

Though Sanders faces much tougher tests soon in the primary schedule, there was a budding optimism that Tuesday night’s results would have a catapulting effect. Campaign operatives were bracing for their largest fundraising night by a factor of several degrees. Other staffers argued that they’d now get a fresh look from the rest of the electorate.

"This means that campaign goes national,” said Renny Cushing, a longtime state representative in New Hampshire and a member of Sanders’ steering committee in the state. “New Hampshire has given victory and validation to Bernie Sanders. The coalition that Bernie put together is applicable to every other state.”

The head-to-head between Sanders and Clinton now moves to the Nevada caucus on Feb. 20 and the South Carolina primary on Feb. 27. Sanders’ job was easier in New Hampshire, where 95 percent of those who voted in the Democratic primary in 2008 were white, and more than half identified as liberal. Clinton has maintained a large lead in polls of Hispanics and African-Americans, two demographic groups that play a large role in determining who wins in the next two states.

The win in New Hampshire could help Sanders build momentum, if what happened in the 2008 primary between Clinton and Obama serves as a guide. An early primary win might give Sanders a better shot if it causes racial minorities to reassess their perceptions of his viability as a candidate. A path to the nomination for Sanders is still extremely narrow, but it’s now possible to imagine what it looks like.

Sam Stein contributed reporting from Concord, New Hampshire. Samantha Lachman reported from Washington, D.C.

Also on HuffPost:

PHOTO GALLERY Iowa Caucus 2016