WASHINGTON - The U.S. economy unexpectedly contracted in the first quarter amid a resurgence in COVID-19 cases and drop in pandemic relief money from the government, but the decline in output is misleading as domestic demand remained strong.

The first decrease in gross domestic product in nearly two years, reported by the Commerce Department on Thursday, was mostly driven by a wider trade deficit as imports surged, and a slowdown in the pace of inventory accumulation from the fourth quarter's robust pace.

A measure of domestic demand accelerated from the fourth quarter's pace, allaying fears of either stagflation or a recession. The Federal Reserve is expected to hike interest rates by 50 basis points next Wednesday. The U.S. central bank raised its policy interest rate by 25 basis points in March, and is soon likely to start trimming its asset holdings.

"The economy is still showing some resilience, but the first quarter GDP report signals the start of more moderate growth this year and next, largely in response to higher interest rates," said Sal Guatieri, a senior economist at BMO Capital Markets in Toronto. "Despite the contraction, the Fed has little choice but to hike aggressively in May to corral inflation."

Gross domestic product fell at a 1.4% annualized rate last quarter, the government said in its advance GDP estimate. The economy grew at a robust 6.9% pace in the fourth quarter. Economists polled by Reuters had forecast the economy growing at a 1.1% rate. Estimates ranged from as low as a 1.4% rate of contraction to as high as a 2.6% growth pace.

Last quarter, the economy also took a hit from supply-chain challenges, worker shortages and rampant inflation. Still, output remains 2.8% above its level in the fourth quarter of 2019. When measured on a year-on-year basis, the economy grew 3.6% in the first quarter.

Imports surged, in part amid front-loading by businesses fearful of shortages because of the Russia-Ukraine war. At the same time, exports plunged. That led to a sharp widening of the trade deficit, which subtracted 3.20 percentage points from GDP growth. Trade has now been a drag on growth for seven straight quarters.

Businesses have turned to imports to satisfy demand, with local manufacturers lacking the capacity to boost production. Though businesses continued to restock, the pace moderated from the fourth quarter, resulting in inventory investment cutting 0.84 percentage points from GDP growth.

U.S. stocks opened higher. The dollar rose against a basket of currencies. U.S. Treasury prices were mixed.

STRONG DEMAND

Growth in consumer spending, which accounts for more than two-thirds of U.S. economic activity picked up to a rate of 2.7% from the fourth-quarter's 2.5% pace, despite taking a hit from the winter wave of coronavirus cases, driven by the Omicron variant. Even with food and gasoline prices soaring, there is no sign yet of consumers pulling back.

Strong wage gains amid a tightening labor market and at least $2 trillion in excess savings accumulated during the pandemic are providing a cushion against inflation. According to data from Bank of America Securities, lower-income consumers, who tend to be disproportionately affected by inflation, were showing greater resilience.

Strengthening labor market conditions were reinforced by a separate report from the Labor Department on Thursday showing initial claims for state unemployment benefits fell 5,000 to a seasonally adjusted 180,000 for the week ended April 23.

Economists had forecast 180,000 applications for the latest week. Business investment accelerated, with spending on equipment increasing at a 15.3% rate last quarter.

That combined with solid consumer spending to boost final sales to private domestic purchasers at a 3.7% rate. This measure of domestic demand, which excludes trade, inventories and government spending, increased at a 2.7% rate in the fourth-quarter. Final sales to private domestic purchasers account for roughly 85% of aggregate spending.

Still, concerns remain that the Fed could aggressively tighten monetary policy and tip the economy into recession over the next 18 months. The housing market is already showing signs of slowing, with the 30-year fixed mortgage shooting above 5%.

But much would depend on how quickly geopolitical tensions and supply chains ease, and whether inflation subsides.

(Reporting by Lucia Mutikani; Editing by Chizu Nomiyama)