With New Hampshire's first-in-the-nation primary just a few weeks away, WGBH News is examining how the Democratic contest is playing out in two very different communities: the old mill city of Berlin in the northern part of the state, and the college town of Hanover on the border with Vermont. This story is part one of a two-part series. Read part two here.

The city of Berlin, N.H., is a three-hour drive from Boston, but it feels even further away than that. Past the exurbs in the state's South, the cities in the center, and even the White Mountain National Forest, Berlin is tucked into the hills by the Androscoggin River. And for decades, it’s been a Democratic stronghold.

"That’s due to the fact that we were a heavy industrial city," said Berlin Mayor Paul Grenier. "To promote workers' rights, and to promote the interests of an emerging middle class — the Democrats were very aligned with that point of view."

Lately, though, Berlin's middle class has been receding. The paper mill where Grenier used to work no longer exists. Empty storefronts dot downtown, and about 20 percent of the city's population lives in poverty, compared to 8 percent statewide, according to U.S. Census data.

The politics of Berlin may be shifting, as well. While Barack Obama won Berlin easily in 2008 and 2012, Hillary Clinton barely eked out a victory there in 2016, topping Donald Trump by just 188 votes.

According to Barbara Tetreault, the managing editor of The Berlin Sun, that slim margin wasn’t a surprise.

"There was a lot of anger from the mill layoffs," Tetreault said. "And [Bill] Clinton was president when NAFTA [the North American Free Trade Agreement] was passed. A lot of the paper makers blamed [Hillary Clinton] for that."

What's more, Tetreault said, some locals simply wouldn’t vote for a woman — and Clinton’s campaign skills weren’t the best. At the the July 4th parade in neighboring Gorham, Tetreault recalled, "She cordoned off the media. She had a rope line. And that got a lot of ridicule, and a lot of press."

All of which raises an obvious question: Was Trump’s near-victory in Berlin the result of Clinton’s liabilities, or his knack for channeling the frustration of voters who feel they’ve been left behind?

It's a difficult question to answer definitively. For what it’s worth, though, Tetreault — whose paper doesn't endorse candidates — thinks a certain type of Democrat would beat Trump handily in Berlin this November.

"This is a city that will probably go for a more moderate [candidate]," she said. "If it’s someone from the progressive wing, I think it’ll be closer."

Grenier has made a similar calculation, and decided that one particular Democrat stands above the rest.

"I’ve committed to supporting Vice President Joe Biden," he said. "Because Biden is not a write-out-a-check, free-for-all-for-everybody kind of candidate. You know, somebody’s got to pay the bill for Medicare for All, College Tuition for All. My wife and I, we worked very hard and very long hours to put our son through school."

Instead of suggesting expensive new programs, Grenier said, Biden is attuned to the needs of what he calls the “working middle class,” including union voters.

Grenier added that another factor — character — played a major role in his decision to back Biden.

"He’s a moral person," Grenier said.

"I was intrigued, actually, to be honest with you, with Trump’s campaign the last time around," Grenier added. "But I have watched him contort the Constitution, and I’ve watched how he conducts himself communicating with other people. Really the most immoral president, certainly in my lifetime."

Ted Bosen, who grew up in Brockton, Mass., and lived in Plymouth before moving to Berlin a few years ago, has a different takeaway after sizing up the Democratic field. He's with Vermont Sen. Bernie Sanders, just like he was four years ago.

"Sanders, in the [2016] primary, got 65 percent of the votes in Coos County," Bosen said. "He carried this city, the only city in the county, overwhelmingly. And he carried the rural area."

Given Clinton's narrow victory over Trump in Berlin in the 2016 general election, Bosen added, the case for Sanders is even stronger now.

"Coos is a microcosm of the Rust Belt," he said. "They’ve lost all these industrial jobs. The farms are kaput. Wisconsin, Pennsylvania, all those areas that flipped for Trump — they look like Coos County."

Asked if the outcome in Berlin would have been different if Sanders had been the nominee rather than Clinton, Bosen's answer is unequivocal. The Vermont senator would have easily won the city's vote, he believes.

"It wouldn't have been the same at all," he said.

Once again, there’s no way to know for sure. Still, like Democrats across the country, the Democrats in Berlin are clearly looking to 2016 for lessons they can use today — and coming to very different conclusions.