When Trump touted the economic recovery in Elkhart, Indiana, on Thursday, he accidentally celebrated President Obama's legacy.

Trump traveled to Elkhart, Indiana, on Thursday to hold another self-congratulatory non-campaign rally, where he devoted much of his speech to touting the economic recovery in the area.

As he so often does, Trump repeated the same talking points about the unemployment rate and the return of manufacturing jobs, soaking up the applause with each line.

But there’s one thing he didn’t seem to realize: By celebrating Elkhart’s economy, Trump accidentally touted President Barack Obama’s legacy at his own rally.

Apparently, Trump was unaware that Obama is widely credited with reviving the economy in Elkhart, which had the nation’s highest unemployment rate in 2009.

Thanks to the Obama-era stimulus package — which included grants for the Elkhart region — and simultaneous bailout of the automobile industry, Elkhart’s economy saw a dramatic turnaround between 2009 and 2016.

Under the Obama administration, the unemployment rate in Elkhart went from 19 percent to 4 percent. Vehicle manufacturing jobs more than doubled. And the high school graduation rate climbed to a new high.

“President Obama came in 2016 to collect credit for the unemployment rate going from 20% to 4%,” Pete Buttigieg, the mayor of nearby South Bend, told CNN. “And now Trump wants to come collect credit for it going from 4% to 3%.”

When Trump climbed on stage Thursday night and bragged about the low unemployment rate, he was actually touting the work of his predecessor — and when the crowd cheered in response, they were actually applauding Obama’s legacy.

Meanwhile, all Trump has to offer the town is the historically unpopular GOP tax scam and a trade war that is likely to harm Elkhart’s automobile manufacturing industry.

As much as Trump tries to downplay Obama’s legacy, he sure seemed proud of it when he touted it Thursday night. Trump’s voters seemed pretty happy with Obama’s accomplishments, too — even though none of them seemed to realize they were celebrating Obama by cheering for Trump.