NELSONVILLE, Ohio ― Last year, Ed Mash decided to run for city council here in Nelsonville, a poor city in Ohio’s poorest county. He believed his small Appalachian town had been forgotten by the political class. Recently retired from a corrections job, he had all the time in the world to shake things up. “People aren’t listened to, there are no jobs in this town, and we’re going bankrupt,” he says. His four-word campaign slogan summed it all up: “Had Enough? I Have!”

A few weeks later, Donald Trump announced he was running for president. Mash didn’t care for the real estate mogul’s personality ― “I wouldn’t have him over for dinner,” the 54-year-old says ― but much of what the Republican candidate railed against, from NAFTA to illegal immigration to political correctness, resonated. He and Trump practically could have swapped campaign slogans. Mash backed him immediately: “He came right out with the same beliefs I had.”

Mash now sits on Nelsonville’s city council, and Donald Trump is headed to the White House. Trump pulled off his stunning upset over Hillary Clinton in large part by flipping the likes of Ed Mash. When he went to cast his ballot for Trump in Ohio’s open Republican primary in March, Mash was actually a registered Democrat. He had voted for President Barack Obama in 2008. And he had spent 10 years as a shop steward for a public-sector union that was among Clinton’s strongest backers.

A bunch of Mash’s buddies working in the state prison system flipped to Trump’s column, too. And so did much of Nelsonville, population 5,197. Four years ago, the town fell overwhelmingly in Obama’s column. The president clobbered Romney in all four of the city’s precincts, beating the Republican by a 40-point margin. Four years earlier, Obama had defeated John McCain here by nearly the same commanding spread.

But last week, Trump ended up narrowly winning Nelsonville, taking three out of four precincts, and edging Clinton 46 percent to 45 overall. The town ― 94 percent white and much of it impoverished ― is a microcosm for what went wrong for Clinton in the election. She still managed to win Athens County at large, a blue oasis that’s home to Nelsonville and Ohio University, but not at the margin that Obama did. Her vulnerability with working-class voters cost her not just Ohio but Michigan, Pennsylvania and Wisconsin.

Despite a lively downtown square with shops and art galleries, Nelsonville is still hurting for jobs. The old coal work is gone. What’s known in town as the Mine is not a mine ― it’s a bar that sells $2 PBR beers. The median household income is below $24,000 per year, or less than half the national average, and more than 40 percent of its residents ― three times the national average ― live below the federal poverty line. Less than half the adult population is in the workforce. The area has been wrestling with a heroin problem for years.

He came right out with the same beliefs I had. Ed Mash on Donald Trump

Mash counts himself lucky. He grew up here poor, but eventually landed a good union job, working as a network administrator for the prison ― about as well as one could do without a college degree. It eventually paid him $43 an hour and provided a good pension after three decades of service. He could have worked a few more years, but he says he retired in part to open up a position for someone else. Some of the best jobs are in corrections. He has two grown kids still in the area, a son who’s a maintenance supervisor and a daughter who works at a Texas Roadhouse restaurant. “You got a job now, you better hang onto it,” he says.

Nelsonville’s most famous employer is Rocky Brands, a name familiar to any devoted whitetail hunter. A mural of the company’s trademark ram looms over the town’s main artery. Rocky Brands grew out of the old factory downtown where footwear was once made by locals, including some of Mash’s relatives. Like most U.S. apparel jobs, those gradually went overseas; the old factory is now a Rocky outlet store where workers sell marked-down Western boots and hunting gear made in places like the Dominican Republic. The company’s CEO personally endorsed Trump.

Chris Barrows, a 55-year-old who voted for Clinton, said Trump’s simple message on trade resonated with people here. “Jobs used to be here. That factory left. I understand what he’s talking about. NAFTA ― that speaks to me,” said Barrows, who argued these points with his ex-girlfriend, a Trump voter. “But just knowing what he does for a living, how he’s got a company that makes money doing just that. I just don’t get it.”

Dave Jamieson/HuffPost The Rocky outlet store in downtown Nelsonville occupies what once was a factory.

Barrows said it didn’t seem to matter that Trump and his family have gotten wealthy making suits, ties and shoes overseas, only that he raised the issue and owned it. Showing just how impervious the campaign was on trade, it even sent Trump’s son, Donald Jr., to the Rocky offices for a visit extolling the brand. A local report on the event doesn’t quote the heir talking about outsourcing, only his love for hunting and how it’s important for the economy.

Across the street from the retail store is Rocky’s headquarters. Locals are proud the company still makes its corporate home here. “It’s still a godsend,” Mash says, noting the high pay of the corporate jobs and the boost to the tax base. But many of those positions are out of reach if you don’t have a college degree. Only 7 percent of the city’s residents have a bachelor’s or higher, according to Census data.

What happened in a place like Nelsonville last week may have shocked a lot of operatives, journalists and pollsters, but it didn’t surprise locals who knocked on doors ahead of the election. That includes Lori Crook, who volunteered for Clinton. She grew up in the area, spent 20 years in New York City, then returned in 2010 and now lives in a small bungalow not far from the town square. Six days after the election, her front porch was piled high with sad-looking Clinton-Kaine signs.

“In a nutshell, her campaign here was saying, ‘You like Obama and his ideas. Then you can have more of the same,’” Crook said. “But that sold her short, and it wasn’t enough. ... They were here to reach the base and get out the vote. But there was no real attempt to have a dialogue.”

Clinton did roll out a plan to revitalize parts of Appalachia hurt by the loss of coal jobs, built on infrastructure spending, the reclamation of old mining sites and new tax credits. Like most Clinton plans, it was steeped in policy and detail. The question was whether anyone actually read or heard it. Taylor Sappington, a 25-year-old progressive who ran with Mash for council, recalled Clinton speaking about the plan when she made a campaign stop at a brewery down the road in Athens. Beyond that, he didn’t hear much about it.

In a nutshell, her campaign here was saying, ‘You like Obama and his ideas. Then you can have more of the same.’ Lori Crook, a Clinton supporter

“It was clear how the Clinton campaign message just wasn’t working here,” said Sappington, who studied at Ohio University and works at the Texas Roadhouse with Mash’s daughter. When Sappington canvassed for Clinton in September, he was taken aback by how many people told him they had settled on voting for Trump. These were registered Democrats.

Mash viewed Trump not as a Republican but as an outsider, just like himself when he ran for council and won. In his opinion, Trump’s talk on trade made him sound like a Democrat should. Mash says he would have taken a serious look at Bernie Sanders had he defeated Clinton in the primary. “He was all about change, too,” he says.

Trump’s focus on jobs and winning let him overlook everything about Trump that Democrats and the media assumed would doom his run. The “Access Hollywood” tape? Didn’t bother Mash ― what annoyed him was the media’s replaying it. Trump’s smear of Mexican immigrants or his plan to ban all Muslims from entering the country? Blown out of proportion. He resented the charge that voting for Trump made him racist.

“Who can tell me there’s any way of fixing this country without jobs?” Mash says. “Black or white, they’ve all got one common goal: They need a job. ... Everyone says the economy is doing great. But I don’t see jobs around here.”

Six days after the election, Mash was having coffee with Sappington at a cafe on the Nelsonville square. The two are friends, despite their very different votes last week, and find a lot of common ground in their council dealings. They had some business to go over before that night’s regular meeting. They also sorted through why an erstwhile Democrat like Mash voted the way he did, and how Trump managed to take a town like Nelsonville.

Mash said his Trump vote should send a message to Republicans as well as Democrats, that both parties need to pay attention to towns like Nelsonville. Sappington couldn’t disagree more on the candidate ― but he also believed Democrats ignored towns like his for too long.

He said the most painful part for him was talking to his mother after the election. They worried about her insurance job, given the odds of an Obamacare repeal, and whether he would still have the right to marry who he wanted to in a couple of years. Above all, as Sappington put it, they worried about “democratic norms and civil society.”

“These are all the thoughts she’s spinning out at me,” he said. “And that hurts. ... We’re worried this is a real, detrimental change.”

Mash assured Sappington he was a free-agent voter, and that he’d reject Trump in four years if Trump didn’t deliver on his promises. He expected to see the wall built along the southern border, to see Obamacare repealed, to see NAFTA renegotiated, and to see the seeds of new jobs in Appalachia.

“We the people, if he’s that bad, can have him removed,” Mash told his friend. “It’ll work out. We’ve had how many presidents over the years, and we’re still here standing.”