Nearly a decade after the Great Recession, the American economy has been undergoing the longest sustained expansion in its history. For President Donald Trump, that has bolstered his reelection chances – and when he isn’t stoking racial disputes, Trump has repeatedly bragged about his stewardship of the economy.

Back in early June, he tweeted, “this is the greatest economy in the HISTORY of America and the best time EVER to look for a job!”

But the economic optimism that Trump tried to cultivate melted away last week.

The global economy has started showing signs that it’s weakening. And fears of a recession quickly spread among experts who noted slowing growth in China as a result of Trump’s unpredictable trade war and signs of an economic contraction looming in the United Kingdom and Germany, Europe’s anchor of financial stability that relies on China to import its goods. And American manufacturers have been particularly hammered as well.

Read more: Weak global growth likely to mean US slowdown, not recession

Only about four in 10 Americans approve of Trump's job performance, according to Gallup. Yet a slew of polls have consistently indicated a slight majority support his handling of the economy. Should it spiral toward a recession, Trump faces a much steeper climb to keep the White House - and it would almost certainly sink his reelection odds. Bank of America analysts recently put the chances of a recession in the next year as one-in-three.

Since the Civil War, only one president - William McKinley in 1900 - won reelection with a recession occurring in the last two years of his term, according to The Washington Post.

If a recession were to happen, it would all but certainly force the Trump campaign to change strategy.

"A full-blown recession would certainly cause the Trump reelection campaign to have to hit the reset button. A strong economy is at the center of President Trump's argument for a second term," the Republican donor Dan Eberhart told The Wall Street Journal.

Privately anxious, but publicly doubling down

Despite reportedly being privately anxious about a recession, Trump is publicly doubling down on the economy, hoping it will power him through 2020.

Read more: Trump is reportedly anxious a recession could tank his reelection chances, but officials aren't openly bracing for one because they're worried about fueling the fire

Trump is already targeting his critics, reportedly believing experts are skewing forecasts against him to derail his reelection campaign. He baselessly accused the media in a tweet on Thursday of trying to provoke an economic "crash" out of malice.

Later that evening at a New Hampshire campaign rally, Trump derided several Democratic presidential candidates and predicted that the economy would nosedive if any of them won. He told his supporters that "you have no choice but to vote for me," The New York Times reported.

But there was still anxiety among voters over turmoil on the stock market, which fell 3% on Wednesday before rebounding slightly the day after. A self-described Democratic voter for Trump, Kevin Steele, told The Times he hoped the trade war with China ended soon with a deal that Trump had long promised.

"I'm hoping to God he closes with China. Just get the deal done," Steele told The Times. "All of my money's in stocks."

Part of the reason the American economy is slowing down is Trump's trade war with China, which has sagged business investment and injected uncertainty into the nation's economic future. Negotiations to strike a deal have proved fruitless so far - and the pain is spreading beyond the borders of the world's two biggest economic powers.

Read more: It's been more than a year since the US-China trade war started. Here's a timeline of everything that's happened so far.

"Fears that the trade war will trigger a recession are growing," a group of Goldman Sachs economists wrote in a note to their clients, Politico reported.

But Trump has instead singled out the Federal Reserve for raising interest rates and, in his view, not doing enough to prevent the malaise - even though its policies have largely aligned with his push for economic growth.

A potent attack line

Still, the public's attitudes are hardening on China. A recent Pew Research Center poll found that China tied with Russia at 24% as the greatest threat to the US. And 60% of Americans have an unfavorable view of China, the highest Pew ever recorded.

But the continuing rise of consumer prices as a result of the trade war - much less a full recession - could hand the 2020 Democrats a potent attack line on Trump throwing away a strong economy.

"He is a slight favorite to win. But he barely won last time and it took a Black Swan series of events to make that happen," Dan Pfeiffer, the former senior aide to President Barack Obama, told Politico. "All Democrats have to do is flip 100,000 or so votes in three states to win and that's a very doable thing," referring to the Midwestern states Hillary Clinton lost to Trump in 2016.