ELKHART, Ind. — President Obama defended his economic record on Wednesday during a visit to an Indiana city that has come to symbolize the nation’s uneven recovery, saying that he created millions of new jobs and questioning Republican Donald Trump’s ability to steer the economy in the right direction.

In a far-ranging interview and town-hall event with PBS NewsHour in Elkhart, Obama touted the economic gains seen under his watch in hard-hit counties like Elkhart, where the unemployment rate soared to nearly 20 percent soon after he took office.

Unemployment in the county, which the Obama administration used as a touchstone early on to gauge its economic recovery plan, now stands at roughly four percent.

“We’re going to have to make sure that we make some good decisions going forward, but the notion that somehow America is in decline is just not born out by the facts.”

“We’re going to have to make sure that we make some good decisions going forward, but the notion that somehow America is in decline is just not born out by the facts,” Obama said in an interview with the NewsHour’s Gwen Ifill.

Nevertheless, in the interview and a town hall held immediately after in downtown Elkhart, the president acknowledged that many people around the country remain worried about making ends meet.

“Even though we’ve recovered, people feel like the ground under their feet isn’t quite as solid,” Obama said. “If they’re feeling insecure, and they’re offered a simple reason to be more secure, people are going to be tempted by it.”

The comment was clearly aimed at Donald Trump, the presumptive Republican nominee. Trump’s populist economic message has energized millions of voters, but his critics — including Obama and former Secretary of State Hillary Clinton, the likely Democratic nominee — have long argued that Trump does not have the experience or gravity to lead the country.

The president declined to invoke the real estate mogul’s full name, saying that he would let Trump “do his advertising for him.”

But Obama criticized Trump’s claims that he could use his business acumen to spur economic growth and tackle other complex issues.

“He just says, ‘I’m gonna negotiate a better deal.’ Well how? How exactly are you going to negotiate that?” Obama said during the town hall portion of the event. “What magic wand do you have? And usually the answer is, he doesn’t have an answer.”

The remarks were a preview of Obama’s likely line of attack later this summer, when he plans to head out on the road to campaign for the Democratic nominee. But while Obama touched on the 2016 presidential election, he spent the bulk of the town hall addressing Elkhart residents’ concerns about the pace of the economic recovery.

“He just says, ‘I’m gonna negotiate a better deal.’ Well how? How exactly are you going to negotiate that? What magic wand do you have? And usually the answer is, he doesn’t have an answer.”

Obama first came to Elkhart County in May 2008, during his presidential campaign. At the time of his visit, the county’s unemployment rate stood at 5.1 percent. The president returned later that year, after securing the Democratic presidential nomination, and gave a speech vowing to spur economic growth in the region.

But the local economy took a nosedive soon after. By the time of Obama’s next visit, in February 2009, the county’s unemployment rate had shot up to 20 percent, making Elkhart a symbol of the many communities struggling to cope with the Great Recession.

Obama used that trip, his first as president outside of Washington, D.C., to make a last-minute push for the stimulus bill, a proposed package of federal spending and tax cuts aimed at reviving the economy.

In August 2009, after Congress passed the $787 billion recovery plan, Obama returned to Elkhart for the fourth time to announce stimulus funding for Indiana. The president also used the trip to push back against Republicans who argued that the stimulus plan wasn’t working.

Most economists now credit the stimulus bill with helping avert a deeper recession. The bill is often cited by Obama supporters as one of the president’s most important achievements. But Republican attacks on the recovery plan never stopped.

And the recovery in Elkhart has been uneven. After several years of slow but steady growth, the recreational vehicle manufacturing industry, which is based in Elkhart and anchors the regional economy, is back in full swing.

“Right now, things are going very well. We’ve gone from high unemployment to having jobs we can’t fill,” said Kyle Hannon, the president of the Elkhart Chamber of Commerce.

Victoria Bowen, a lifelong Elkhart resident who works at an RV factory, said she was struck by the number of help wanted signs around the town, just a few years after many businesses were shutting down or laying off workers.

“That means the economy is going again,” Bowen said, adding that she credits Obama for the city’s resurgence. “The economy was down, and he brought it back. I think Obama has done a good job.”

But others scoffed at the notion that Elkhart had recovered, and criticized Obama for not doing enough to create new jobs.

“He’s come to Elkhart a few times, and it seems like he’s done nothing to try and make things better,” said Steven Good, a homeless man who has struggled to find housing and work in the area. “He made lots of announcements but they were just words. Empty promises.”

Conversations with residents across the city revealed a racial divide, in particular among white conservatives who said they disliked the president and African-Americans, like Bowen, who are Democrats and support Obama.

The divide mirrored nationwide surveys that show more than 80 percent of blacks approve of the job Obama is doing. In contrast, his approval rating among whites has been stuck below 50 percent for the past several years.

More broadly, opinions of Obama in Elkhart broke down largely along partisan lines, with most Democrats in interviews expressing support for the president and most Republicans opposing his economic policies.

“Politicians get the most attention the more outrageous they sound. So if you’re civil and quiet and polite, nobody covers you. But if you say something crazy and rude you’re all over the news.”

Obama focused on his record in the PBS NewsHour town hall, and has used other interviews this year to burnish his legacy in the final months before he leaves office. But as Hannon noted, arguments over Obama’s legacy will continue long after he departs the White House.

“It’s going to take several years for that legacy to settle in,” Hannon said.

In the short term, Obama’s popularity in places like Elkhart could help determine the presidential election.

Trump will need to perform well in states across the Midwest in order to beat Clinton in the fall. Obama carried Indiana in the 2008 general election, becoming the first Democratic candidate to win the state since 1964. But Obama lost Indiana to Mitt Romney by 10 points in 2012, and the state is leaning Republican this year as well.

Trump won the GOP primary in Indiana by nearly 20 points last month, forcing Senator Ted Cruz of Texas and Ohio Gov. John Kasich out of the race.

At the NewsHour town hall, Obama said there would be “plenty of time” for him to campaign for Trump’s opponent once the last major primaries take place next Tuesday.

“There’s been a healthy debate in the Democratic primary, and it’s almost over,” Obama said. “I think we’ll probably have a pretty good sense next week of who the nominee is going to be.”

Clinton has a large delegate lead over Senator Bernie Sanders of Vermont, but Sanders won several states last month and could be competitive in California, which awards the bulk of the remaining pledged delegates, next week.

Obama appeared eager to take on Trump, though he lamented the culture of modern-day campaigning.

“Politicians get the most attention the more outrageous they sound. So if you’re civil and quiet and polite, nobody covers you. But if you say something crazy and rude you’re all over the news,” Obama said.

He added, “that has fed this kind of arms race of insults and controversy that doesn’t shed a lot of light even though it generates a lot of heat.”

Whatever happens statewide in November, Elkhart County will likely wind up in the Republican column. The county has voted for the Republican candidate in the past four presidential races.

“This is a very, very Republican county,” Hannon said. “And that might be part of the reason why Obama doesn’t get a lot of credit around here.”

Watch a live Spanish translation of the town hall here. (Mira la transmisión con traducción al español instantánea aquí.)

The NewsHour published a series of stories on Elkhart this week. Among them: