Sen. Tim Kaine, left, listens as Republican challenger Corey Stewart speaks during their first debate in Hot Springs, Va., on July 21. (Steve Helber/AP)

Corey A. Stewart, the Virginia Republican seeking to unseat Sen. Tim Kaine (D) in November, went to Danville on Friday to try to soften the backlash he has received after he depicted the Southside city as a dystopian failure.

Standing in front of the former site of the Dan River Mills textile factory, he acknowledged that the city has made strides since losing about 15,000 jobs when that business closed in 2005, amid a simultaneous collapse of tobacco companies.

But trade policies under President Barack Obama that Kaine supported have kept the community of nearly 42,000 people from reaching a full recovery, Stewart said.

“I know that they’re trying to do the best that they can and they’ve done a lot of things,” he said about local community leaders. “But we need to expect — here in Danville and in Virginia and across the country — we need to expect more from Washington.”

Stewart came under heavy fire from local leaders, including Danville’s Republican vice mayor, after he characterized the city during a July 21 televised debate as a place of “boarded-up shops” that is still being abandoned by residents, blaming the city’s problems on bad trade decisions.

“It’s boarded up. People have left. Young people have left. The opiate crisis is completely out of control. The murder rate is way up. All crimes are way up. Suicides are up. It’s sad,” Stewart said.

While still struggling, Danville has crawled back toward stability in recent years with an overhaul of its downtown River District that has included converting old manufacturing warehouses into loft-style apartments, breweries and restaurants.

The city has also attracted a small but growing hub of precision manufacturing companies, officials said.

Stewart’s comments during the debate provoked a wave of critical newspaper editorials and online comments, threatening his support in a heavily Republican region where he hopes to turn out voters in November. Stewart, chair of the Prince William Board of Supervisors, won 52 percent of the vote in Danville during the June GOP Senate primary election and broke even with Ed Gillespie during last year’s gubernatorial primary with about 42 percent of the vote.

Hoping to capi­tal­ize on Stewart’s gaffes, Kaine’s campaign announced Friday that it plans to launch radio and digital ads highlighting Stewart’s comments while listing measures Kaine has backed that helped Danville’s recovery, including the opening of an Ikea furniture factory there in 2008, when Kaine was Virginia’s governor.

“Corey Stewart is an elite D.C. international trade lawyer who has personally profited off of NAFTA,” Ian Sams, Kaine’s spokesman said, referring to Stewart’s work helping companies navigate trade laws. “So, when he comes down to Danville selling snake oil, the good people there can see right through it.”

Several local leaders in Danville said they were puzzled by Stewart’s remarks, mainly because they no longer see their community as a victim of shifts in the global economy that caused textile companies such as Dan River Mills to move overseas in pursuit of cheaper labor and manufacturing costs.

While a lack of jobs in the area is still a problem, the unemployment rate has dropped to about 5.4 percent, the lowest in more than two decades, officials said. Meanwhile, crime is also going down, with four homicides so far this year, compared to 16 in all of 2016.

“It’s disappointing to hear those comments because they seem either outdated or just generally false,” said J. Lee Vogler, who is the city’s vice mayor and former chair of Danville’s Republican Party committee.

“In Danville, we’re focused on moving forward,” he said. “We’re not moving back to yesteryear and feeling sorry for ourselves. For a number of years now, we’ve had people, Republicans and Democrats, working hard to rebuild this economy.”

Stewart, an ardent supporter of Trump, is following the Republican president’s playbook by striking a populist note in Danville that seeks to tap into feelings of alienation in a portion of Virginia that generally feels left behind in the state’s otherwise thriving economy, political analysts say.

On Friday, his campaign labeled the Danville stop as the start of a “Rebuilding Virginia Tour.”

Stewart said that he supports Trump’s pursuit of better trade deals with China and other competing countries that will allow manufacturing jobs to return to places like Danville.

“We’ve had enough, and we’re bringing back manufacturing to Danville — in fact, all across the United States of America,” Stewart said at his news conference, calling Kaine “weak” on trade.

Stephen J. Farnsworth, a political-science professor at the University of Mary Washington in Fredericksburg, said the fact that Stewart is focusing energy in southwestern Virginia shows that he is still trying to build support among Republicans.

GOP leaders in the state have been split over the Minnesota native, whose push to preserve Confederate monuments in the state — and once dressing up like a Southern gentleman during an “Old South Ball” in Danville — has led to questionable ties to some white supremacists that Stewart has been forced to disavow.

“The fact that Corey Stewart is spending a lot of time in the Southside and southwest Virginia — an area that he ought to have, politically speaking, in his pocket — suggests that he is still trying to energize the Republican base,” Farnsworth said.

But, while Stewart’s message may appeal to some disaffected voters in the area, “an anti-trade message essentially will not be all that successful in the suburbs, which is where elections are won or lost in Virginia statewide,” he said.

James Buckner, a Danville councilman who worked at the Dan River Mills factory after high school, said Stewart’s remarks have motivated local leaders to work harder to improve the city’s economy.

During conversations inside local coffee shops and businesses during the past week, several people have expressed resentment against Stewart, said Buckner, an independent.

“Every city has challenges, but to say that we’re a forgotten city or that the city has given up is totally false,” he said. “You can’t bash the city the way he has and expect to get support from them.”