Intel Corp suffered its largest-ever quarterly loss and said it would remain in the red as it prepares for the market recovering from the sharp fall in personal-computer sales that hammered its business.

Sales fell to a level not seen since 2010. Intel on Thursday posted revenue of $11.7 billion for the first quarter, above estimates from analysts surveyed by FactSet. That marked a 36% decline from the prior-year period.

Shipments of PCs, which drive a large share of Intel’s revenue, fell 29% year-over-year in the first quarter, according to International Data Corp. figures, extending a slump that began early last year. Consumers rushed to buy computers, smartphones and other electronics at the beginning of the pandemic, spurred by the shift toward remote learning and working. That reversed last year as people returned to prepandemic routines.

Intel’s PC-chip division reported a 38% fall in revenue for the first quarter to $5.8 billion. However, Chief Financial Officer David Zinsner said the market was on course to return to normal later this year once PC makers run through excess inventories of chips and start placing new orders.

Intel’s sales slump translated into a $2.76 billion loss for the first quarter. It was the company’s second loss in a row and eclipses what had been its largest loss of $687 million, booked in the final quarter of 2017. And Intel said it would likely post another loss in the current quarter.

The company projected sales in the current quarter of $11.5 billion to $12.5 billion, though still well below the year-earlier figure. The midpoint of the forecast came in slightly ahead of Wall Street estimates.

The company’s shares rose more than 5% in aftermarket trading.

Intel is planning hundreds of billions of dollars of investments in new factories, in part to support its new contract chip-making arm. To adjust to the downturn and help pay for those efforts, the company has slashed projects and divested some of its businesses. It has also entered into an unusual financing arrangement with Canada’s Brookfield Asset Management Inc. where the companies are splitting the cost of a $30 billion factory expansion in Arizona and Brookfield is to receive a share of its revenue.

The company is aiming to wrap up a second such financing deal connected to other factories this year, Mr. Zinsner said Thursday.

Intel also has indicated it would aim to secure large grants from the U.S. government under the $53 billion Chips Act, designed to foster the growth of domestic chip making after the industry’s flight to Asia in recent decades. That money could defray the cost of Intel’s factory projects in Arizona, Ohio and elsewhere.