WASHINGTON (Reuters) – The U.S. economy rebounded more strongly than initially thought in the third quarter, the government confirmed on Wednesday, but higher interest rates as the Federal Reserve battles inflation have raised the risks of a recession next year.

Gross domestic product increased at a 2.9% annualized rate, the government said in its second estimate of third-quarter GDP. That was revised up from the 2.6% pace reported last month. The economy had contracted at a 0.6% rate in the second quarter.

Economists polled by Reuters had forecast GDP growth would be raised to a 2.7% rate.

The upward revision reflected upgrades to growth in consumer and business spending as well as fewer imports, which offset the drag from a slower pace of inventory accumulation.

When measured from the income side, the economy grew at a 0.3% rate. Gross domestic income (GDI) had contracted at a 0.8% pace in the second quarter. In principle, GDP and GDI should be equal, but in practice diverge as they are estimated using different and largely independent source data.

The average of GDP and GDI, also referred to as gross domestic output and considered a better measure of economic activity, increased at a 1.6% rate in the July-September period after shrinking at a 0.7% pace in the second quarter.

Profits from current production decreased at a $31.6 billion rate in the third quarter after rising at a $131.6 billion pace in the second quarter.

With the Fed in the midst of what has become the fastest rate-hiking cycle since the 1980s, the economy is in danger of sliding into recession as early as in the first half of next year. Economists, however, believe any downturn will be short and mild because of unprecedented labor market strength.

The housing market is crumbling, with residential investment contracting for six straight quarters, the longest such stretch since the housing market collapse in 2006.

Consumer and business confidence are in decline, which could hurt spending and undercut job growth.

(Reporting by Lucia Mutikani; Editing by Nick Zieminski)