Financial markets are flashing a key warning sign of a recession, and the global economy is weakening as the U.S.-China trade war intensifies.

All of which is heightening fear about the U.S. economy and about whether the 10-year expansion, the longest on record, is nearing an end.

On Wednesday, a rare realignment in interest rates intensified those worries: The yield on the benchmark 10-year U.S. Treasury note briefly fell below the yield on the 2-year Treasury for the first time since 2007.

Normally, investors earn higher interest on longer-term bonds than on short-term ones. Put another way, the government will usually pay more to investors who are willing to lend their money for longer periods.

So when that equation reverses itself — when longer-term Treasury notes pay less than shorter-term ones — economists call it an “inverted yield curve .” An inverted curve suggests that bond investors expect growth to slow so much that the Federal Reserve will soon feel compelled to slash short-term rates to try to support the economy.

In short, it’s a sign of economic pessimism. Inverted curves are, in fact, remarkably reliable harbingers of recessions: They have occurred before each of the last five downturns.

The inversion sent stocks plunging Wednesday, with the Dow Jones tumbling 800 points, or 3%. Still, an inversion says little about timing of a forthcoming recession. On average, an inversion occurs roughly two years before a downturn.

So are we nearing a recession?

Many economists worry that recession odds are rising. Julia Coronado, chief economist at MacroPolicy Perspectives, sees a 40% probability of a downturn within the next 12 months, up from 30% last month.

Those concerns stem in part from the U.S.-China trade war, which appears to have discouraged many businesses from expanding and investing in new buildings and equipment. It is also harming Germany's export-led economy, which shrank in the second quarter. A chaotic British exit from the European Union looms this fall. Japan and South Korea are also engaged in a trade fight.

And the Trump administration has essentially acknowledged that its planned 10% tariffs on $300 billion of mostly consumer goods from China would hurt U.S. shoppers. That's because many retailers would raise prices to account for the higher tariffs on Chinese imports they would have to pay.

On Tuesday, Trump said he would delay, from Sept. 1 to Dec. 15, the tax on more than half those imports to avoid raising prices for holiday shoppers.

Still, for now, most economic signs appear solid. Employers are adding jobs at a steady pace, the unemployment rate remains near a 50-year low, and consumers are optimistic.

"I wouldn't forecast a recession just on the yield curve," said Eric Winograd, senior economist at AllianceBernstein. "I would want to see other signals that point to that, but we're not seeing them right now."

What is a recession?

One rule of thumb is that a recession occurs when gross domestic product, the broadest measure of U.S. growth, contracts for two straight quarters.

But that’s not the official definition. The National Bureau of Economic Research, a private organization of economists that formally defines recessions, say they occur when there is “a significant decline in economic activity” lasting for more than “a few months,” reflected in a range of economic data, including GDP, incomes and jobs.

The bureau makes its determination retroactively. So the economy can actually be in recession for some time before it is officially declared so. The bureau, for example, declared in November 2008 that the Great Recession had begun 11 months earlier.

The most commonly cited indicator of a weakening economy is weekly first-time applications for unemployment benefits. People are eligible for the benefits if they've been laid off or have lost a job through no fault of their own. So a rising pace of applications suggests that companies are cutting jobs.

Last week, first-time applications amounted to 209,000, a very low level historically.

The Institute for Supply Management's survey of manufacturers is another important gauge. Lately, it is showing that factory activity has been slowing and is near the level that indicates it is shrinking. Manufacturing makes up a relatively small part of the economy but is more sensitive to downturns than services. That's because people cut back on car-buying and other large purchases when they feel economically squeezed.

If there is a recession anytime soon, it’s hard to tell how long or deep it will be. But many economists think it might be relatively mild. That’s because American households are in stronger financial shape than before the Great Recession. Mortgages and household debts, as a percentage of overall incomes, are lower. And ultra-low interest rates make it easier for consumers to stay current on their debts.

What to do if a recession is coming

Because it’s hard to know when or whether a recession will occur, most experts advise against drastic moves, such as rashly selling stock holdings or postponing major purchases that you can otherwise afford.

Generally, it makes sense to do what most personal finance experts typically recommend: Pay off credit card and other high-interest debt and make sure you have a cushion of savings.

The irony is that such advice, if widely adopted, could make a recession more likely as millions of consumers collectively pull back on spending. Companies’ reluctance to invest amid the uncertainty of the trade war has already slowed growth.

"We could end up talking ourselves into a recession," said Jay Bryson, global economist for Wells Fargo.