Democrats were divided in Massachusetts on Super Tuesday, leading former Secretary of State Hillary Clinton and the establishment wing of the state's party to a narrow victory against the boldly liberal insurgent campaign by Vermont Sen. Bernie Sanders.

Near the end of a late night of vote counting, Clinton edged out Sanders in Massachusetts with 51 percent of the vote to Sanders's 48 percent.

Nationally, the former secretary of state won eight out of the 11 state presidential primaries in play Tuesday, leaving Clinton with a commanding lead over Sanders among the Democratic delegates who will select the party's nominee.

Here in Massachusetts, the Democratic race generated significant interest among Democrats and left-leaning unenrolled voters who submitted around 1 million ballots on the Democratic side. As close as the race was, it was nothing compared to the 1.3 million Democratic ballots from Clinton's win over Barack Obama in 2008.

The Clinton campaign pulled out many, if not all, of the big guns Massachusetts has to offer. Boston Mayor Marty Walsh and Attorney General Maura Healey lead the charge with marquee endorsements and campaign events around the state. Sanders had few elected backers, but a groundswell of support from younger voters propelled the Vermont senator to a tighter finish than many local political pundits expected.

"She pulled out every stop, there's no doubt about that," former city councillor and veteran political observer Larry DiCara said of Clinton's campaign and surrogates in Massachusetts.

"I haven't seen so many top Democrats endorse somebody since Warren Tolman," DiCara said, referring to the former state senator who was heavily endorsed by Walsh and others but was beat handily for attorney general in the 2014 Democratic primary.

Republicans were a whole other story, as the gunslinging campaign of businessman Donald Trump continued to trounce his more traditional competition in Massachusetts and other states.

Trump's growing base of Republicans, independents, and even some Democrats, disillusioned with politics as usual, brought record-breaking numbers of voters to primary polls. Secretary of State William Galvin predicted that as many as 700,000 GOP ballots might be pulled Tuesday, beating the previous record of 505,000 for the 2000 race between George W. Bush and Sen John McCain.

"I think what Trump has shown in previous primaries and now in Massachusetts is, he's building up a broad coalition of new voters for the Republican party and for his campaign," Rep. Geoff Diehl (R-Whitman), the first elected official in the state to endorse Trump, told WGBH News Tuesday night.

Many of the same Massachusetts voters who rejected conservative choices like Bush in 2000 and Pat Buchanan in 1996—and who gave Gov. Michael Dukakis a hometown lift over Jesse Jackson in 1988—gave approval to Donald Trump this year.

"It's pretty clear that Donald Trump will be the nominee," Diehl said, adding that he's looking forward to the rest of his party uniting behind Trump.

"I think you're going to start to see people in Massachusetts definetly come around," Diehl said.

Trump finished Tuesday with 49 percent of the vote, dominating runners-up Ohio Governor John Kasich and Florida Sen. Marco Rubio.

The closest correlations to this Super Tuesday was the last time the presidency was open and up for grabs in 2008. That year, Clinton fended off another insurgent, Illinois Sen. Barack Obama, by 15.4 points before Obama surged to the nomination with wins in several other states.

It was also in 2008 that hometown boy and former Gov. Mitt Romney landed what would have been a solid a win in any other state against eventual nominee McCain by just over ten points. Two days after several bruising Super Tuesday performances, Romney ended his first run for president.

Four years ago, the incumbent president did not face a challenge, but Romney's second campaign scored a lopsided victory in Massachusetts with 72 percent of the vote to Rick Santorum's 12 percent.