In many ways, St Joseph, Mo., is Trump country.

Located about 55 miles north of Kansas City, the town of about 76,000 is almost 90% white. At about the same time the North American Free Trade Agreement came into effect in 1994, drawing major employer Lee Jeans to outsource its operations to Mexico, floodwaters ravaged the city and partially destroyed its airport. A little over a decade later, it was badly hit by the Great Recession: unemployment peaked at 9.9% in January 2010, above the then-national level of 9.7%.

Home to many of the “forgotten” Midwesterners attracted to Donald Trump’s rhetoric on immigration and trade, it duly rewarded the Republican insurgent. Trump won nearly 60% of the vote there in last year’s presidential election, increasing the margin of Mitt Romney’s narrow victory over Barack Obama in 2012.

Look closer however, and the appeal of “America First” walled off from the world becomes less clear. The unemployment rate in St. Joseph currently stands at 3.1%, below the national average of 4.1%. Astonishingly, more locals were engaged in the manufacturing trade in 2015 than 2000, census data show. The town’s Chamber of Commerce head, a former Texas émigré who’s hardly a egghead globalist, frets that the Trump White House will pull America out of NAFTA. “It would be devastating to the economy in the Midwest,” R. Patt Lilly tells Moneyish.

The success of St. Joseph, long in the shadow of its much larger neighbor about a 45-minute drive away, offers lessons to geographical neighbors with decimated industrial bases. Trump’s success in capturing Midwestern states like Michigan and Ohio, which in recent years have trended Democratic during presidential contests, was key to his victory last year. It’s also a riposte to critics of free trade and globalization.

How did St. Joseph get here? For one, it benefited from its proximity to centers of education, which serve as incubators of talent while fostering the sort of cultural vibrancy that attracts businesses. Right in town is Missouri Western State University, which enrolled a record 5,388 students this academic year. The Kansas City campus of the University of Missouri is nearby, while Kansas State University is about 70 miles away. Complementing them is the Kauffman Foundation, a non-profit endowed by a late pharmaceutical philanthropist to create education and entrepreneurial activities.

“There are great schools and opportunities nearby with a lot of cultural activities,” says Jeffrey Hornsby, a management professor at University of Missouri-Kansas City, who works with local startups, many supported by the Kauffmann Foundation. “While still not enough is done to supply need in the STEM education area, there are a lot of strong engineering schools. That brings energy.”

In turn, St. Joseph hasn’t been afflicted with the same wave of young people departing for better prospects that have bedeviled similarly sized towns across the Rustbelt. “The brain drain was there 10 or 20 years ago, it’s not that pronounced anymore,” says Lilly. In 2010, 21.2% of Buchanan County’s population was between the ages of 20 and 34, a slight increase from 20.8% ten years before.

That’s partly because St. Joseph serves as a low-cost satellite to Kansas City, but also due to investments made by local businesses like food ingredients producer Lifeline, which recently spent $1.8 million installing a new packaging line. Altec, an international construction equipment maker that employs around 900 employees locally, last year announced it had budgeted $1.9 million on office expansion.

These businesses survived, indeed thrived, thanks to globalization. St. Joseph recorded $1.02 billion in exports in 2015, an increase of over 70% from $285 million a decade ago, according to the Missouri Economic Research and Information Center. About 17.6% of its exports went to Mexico or Canada. Nearly half of that—$531.45 million—was sent to countries that had enrolled in the Trans Pacific Partnership, an Obama Administration-supported free trade pact that Trump pulled the U.S. out of.

“We ship from the East Coast to the West Coast, down to Mexico and export too,” says Kelly, Lifeline’s chief executive, adding that the firm capitalizes on being in the center of the country and close to quality road and rail links. “That’s why I’m very concerned about the future of NAFTA and what D.C. is going to do.”

He particularly fears that Trump will pull the U.S. out of NAFTA—thus far, Trump is renegotiating the deal—that will see tariffs rise and regulations increase. “NAFTA has been very beneficial to the agriculture sector,” Kelly says. “The trade barriers are reduced and there are no tariffs on our product as a barrier of entry. Many things are minimized from a regulatory standpoint.”

Also readYoung women are getting richer, as young men get poorer

The benefits aren’t just concentrated among the management classes. St. Joseph reported median household income in 2015 of $43,298, almost 10% more than in 2010. (Median income statewide rose just 4.1% in the same period, according to Census data.) Whereas the town was once seen as a cheaper appendage to Kansas City, “wages are now very comparable,” says Lilly, adding that this trend is not just driven by low unemployment nationwide. “The reality is that jobs today require greater skill levels and employers have to pay more.”

The town’s employers are both trying to future proof their employees, while ensuring that it’s not just those with traditional four year degrees that thrive. Lifeline has kept its labor force constant at about 120 heads, and retrained its workers for its new packaging line, which has increased yield productivity by 25%. The company regularly scours the nearby colleges for potential employees and is also seeking to bring in new blood it can train in-house. The work “used to be very manually intensive—lifting bags and checking the weighing systems,” Kelly, the CEO, says. “It’s more automated now…but the workers on the line are very adept at running the system.”

Two years ago, the Chamber of Commerce and allies including the local public school district and businesses brought in a two-semester program that originated in Virginia and has helped individuals secure decent factory jobs. The Manufacturing Technician Certification, as the program is known, trains students in everything from math to spatial reasoning and business management. In St. Joseph, it’s since graduated about 50 students.

“It touches on robotics, machination and electronics—skills that are typical on the factory floor today,” says Lilly, though he acknowledges that the fight for sustainable employment is a slog even with such programs. “It’s not that employers are cutting back on employment but where a $5 million investment may have once led to 50 new hires, a company “might just hire five or ten” people today.

That means that some remain left behind. “The job scene is awful and I wouldn’t recommend anyone live here,” says Salena Embrey, a high school-educated single mom who currently works as a chef at a residential care center. “It is the worst town and housing costs are way high.” Earlier this year, she launched a GoFundMe campaign seeking $900 to help get her own house. “It’s difficult to do on my own. I do work! And am not just trying to get money to blow,” she wrote in her plea. Nearly five months after she posted that call, Embrey hasn’t received any donations.

As demographics change, St. Joseph hasn’t been spared the racial tension that has flared up elsewhere in the country. People of Hispanic or Latino descent make up 6.5% of the town’s population, more than double that of in 2000, when they made up 2.6% of St. Joseph. Last year, a local police officer made national headlines after appearing in uniform on a racially charged rap video in which images of African American pioneers like the Rev. Al Sharpton and President Barack Obama were burnt.

The officer, who was later suspended, was also filmed reaching for his gun to the lyrics “keep your nose clean and obey simple laws…maybe the police won’t be so quick to f—king draw down.” (The officer’s attorney told the Associated Press that he wasn’t aware that he was being filmed for such a video and would not have participated otherwise.)

“There are folks with issues that need to be dealt with,” says Kelly, though he characterizes St. Joseph as broadly supportive of diversity. “We have other ethnic groups moving in to take jobs and we need them to keep the factories moving. That leads to opinions by people who’ve been here a long time.”