As some of the world’s biggest economies stumble into recession, the United States keeps chugging along.

Both Japan and the United Kingdom said Thursday their economies likely weakened during the final three months of 2023. For each, it would be the second straight quarter that’s happened, which fits one lay definition for a recession.

Yet in the United States, the economy motored ahead in last year’s fourth quarter for a sixth straight quarter of growth. It’s blown past many predictions coming into last year that a recession seemed inevitable because of high interest rates meant to slow the economy and inflation.

Give much of the credit to U.S. households, who have continued to spend at a solid rate despite many challenges. Their spending makes up the majority of the U.S. economy. Government stimulus helped households weather the initial stages of the pandemic and a jump in inflation, and now pay raises are helping them catch up to high prices for the goods and services they need.

On Thursday, a report showed that fewer U.S. workers filed for unemployment benefits last week. It’s the latest signal of a remarkably solid job market, even though a litany of layoff announcements has grabbed attention recently. Continued strength there should help prop up the economy.

Of course, risks still loom, and economists say a recession can’t be ruled out. Inflation could reaccelerate. Worries about heavy borrowing by the U.S. government could upset financial markets, ultimately making loans to buy cars and other things more expensive. Growing losses tied to commercial real estate could mean big pain for the financial system.

But, for now, the outlook continues to appear better for the United States than many other big economies. The mood on Wall Street is so positive that the main measure of the U.S. stock market, the S&P 500 index, topped the 5,000 level last week for the first time.

“First and foremost, it’s important to emphasize that the market’s performance is more a reflection of a thriving economy rather than unwarranted ‘animal spirits’ from investors,” according to Solita Marcelli, chief investment officer, Americas, at UBS Global Wealth Management.

When it upgraded its forecast for global growth in 2024 a couple weeks ago, the International Monetary Fund cited greater-than-expected resilience in the U.S. economy as a major reason.

Several unique characteristics of the U.S. economy have sheltered it from recessionary storms, analysts say. The U.S. government provided about $5 trillion in pandemic aid in 2020-2021, far more than overseas counterparts, which left most households in much better financial shape and supported consumer spending well into 2023.

The Biden administration has also subsidized more construction of manufacturing plants and infrastructure through additional legislation passed in 2021 and 2022 that was still having an impact last year. About one quarter of the U.S. economy’s solid 2.5% growth in 2023 was made up of government spending. Republican critics, however, charge that the extended spending contributed to higher inflation.

“We had some policies that I do think helped us a lot,” said Diane Swonk, chief economist at KPMG. “But also the structure of our economy is so much different.”

Americans have been better protected from rising rates than U.K. counterparts, for example, because most U.S. homeowners with mortgages have long, 30-year fixed rates. As a result, the Federal Reserve’s rapid rate hikes of the past two years — which have lifted mortgage rates from around 3% to about 6.7% — have had little effect on many U.S. homeowners.

Yet their British counterparts carry mortgages that have to be renewed every two to five years. They’ve struggled with rapidly rising mortgage rates as the Bank of England has lifted borrowing costs to combat inflation.

Catherine Mann, a member of the Bank of England’s interest-rate setting committee, said Thursday that the U.K. economy’s slowdown should be temporary. There are already signs in business surveys that the economy is picking back up, she added.

“The data we have today is rear-view mirror,” she said on the sidelines of an economic conference in Washington. Forward-looking reports “are all looking good.” Like the Fed, the Bank of England is considering reducing its benchmark rate once it is confident inflation is under control.

Another benefit for the United States is that it experienced a surge in immigration in recent years, which has made it easier for businesses to fill jobs, potentially expand their operations, and has led to more people earning wages — and then spending those earnings.

Japan, by contrast, is rapidly aging and has seen its population shrink for years, as it is less open to foreign labor. A declining population can act as a powerful drag on economic growth.

In Europe, consumer sentiment is weak among consumers who are still feeling the effects of higher energy prices caused by the war in Ukraine.

Even China, whose economy is growing faster than the United States’, is under heavy pressure. Its stock markets have been among the world’s worst recently due to worries about a sluggish economic recovery and troubles in the property sector.

The U.S. economy faces its own challenges. Its growth is forecast to cool this year as big hikes to interest rates by the Federal Reserve make their way fully through the system.

A report on Thursday may have given a nod to that. Sales at U.S. retailers slumped by more in January from December than economists expected.

Some pillars of support for consumer spending may be weakening. Student loan repayments have resumed, consumers have largely spent their pandemic stimulus money and credit-card balances are high.

Perhaps most frustrating is the fact that prices for things at the market are still much higher than they were before the pandemic. Lower inflation means prices are rising less quickly from here, not that they’re falling back to where they used to be.

Coping with inflation remains U.S. consumers’ top concern, except for those making more than $150,000, according to a recent survey by Morgan Stanley.

When McDonald’s CEO Chris Kempczinski discussed his company’s latest quarterly results, he said he’s not seeing much change in behavior among middle- and upper-income customers. But “where you see the pressure with the US consumer is that low-income consumer, so call it $45,000 and under. That consumer is pressured.”