BEIJING >> China faces a drawn-out struggle to revive an economy that suffered its biggest contraction since possibly the mid-1960s after millions of people were told to stay home to fight the coronavirus.

The world’s second-largest economy shrank by 6.8% from a year earlier in the quarter ending in March after factories, offices and shopping malls were closed to contain the outbreak, official data showed Friday. Consumer spending, which supplied 80% of last year’s growth, and factory activity were weaker than expected.

China, where the pandemic began in December, is the first major economy to start to recover after the ruling Communist Party declared the virus under control. Factories were allowed to reopen last month, but cinemas and other businesses that employ millions of people still are closed.

There are signs that after an “initial bounce” as controls ended, “the recovery in activity has since slowed to a crawl,” said Julian Evans-Pritchard of Capital Economics in a report.

“China is in for a drawn-out recovery,” he said.

The last contraction this big was 5.8% in 1967 during the upheavals of the ultra-radical 1965-75 Cultural Revolution, according to Iris Pang of ING.

Forecasters earlier said China might rebound as early as this month. But they say a sharp, “V-shaped” recovery looks increasingly unlikely as negative export, retail sales and other data pile up.

Instead, they expect a gradual crawl back to growth in low single digits in the coming quarters. For the full year, forecasters including UBS, Nomura and Oxford Economics expect little to no growth.

In total, China has reported 4,632 deaths after the total for Wuhan, the city of 11 million people at the center of the outbreak, was revised upward Friday. The mainland has announced 82,367 cases.

Retail sales fell 19% from a year earlier in the first quarter. That improved in March, the final month of the quarter, to a decline of 15.8%. But consumers, jittery about possible job losses, are reluctant to spend despite government efforts to lure them back to shopping malls and auto showrooms.

That is a blow to automakers and other companies that hope China will power the world economy out of its most painful slump since the 1930s.

Job-hunter Ni Hong’s challenge highlights the problem. Ni, 32, quit her job in Beijing in January to find a new one, but the virus disrupted those plans. Ni is paying her mortgage out of her savings and avoiding other spending while she looks in a market flooded with newly laid-off workers.

“In the past, there were maybe two or three candidates for a post,” Ni said. “Now, I have eight to 10 competitors, so the chance for me to be eliminated is much higher.”

That is a political challenge for the ruling party, which bases its claim to power on China’s economic success. The party appealed to companies to keep paying employees and avoid layoffs during the shutdown. But an unknown number have failed, adding to public anxiety.

The economy already was squeezed by a tariff war with President Donald Trump over Beijing’s technology ambitions and trade surplus. Last year’s growth sank to a multi-decade low of 6.1%.

Exports fell 6.6% in March from a year earlier, an improvement over the double-digit plunge in January and February. But forecasters say demand is bound to slump in America and Europe as anti-virus controls keep shoppers at home.

“Lingering consumption weakness and sliding foreign demand will weigh on the upturn,” said Louis Kuijs of Oxford Economics in a report.

Growth was stronger than some forecasts that called for a contraction of up to 16% but this is the biggest contraction since market-style reforms started in 1979.

“The numbers were even uglier than most anticipated, which is good!” said Andy Rothman of Matthews Asia in a report. “These ugly numbers indicate that the leadership didn’t fudge the data to hide the seriousness of the situation.”

Investment in factories, real estate and other fixed assets, the other major growth driver, sank 16.1%.

Auto sales sank 48.4% from a year earlier in March. That was better than February’s record 81.7% plunge but is on top of a 2-year-old decline that is squeezing global and Chinese automakers in the industry’s biggest global market.

Asian stock markets rose following the announcement, which was in line with investor expectations. By mid-afternoon, Tokyo’s benchmark Nikkei 225 index was up 3% and Hong Kong’s Hang Seng was 2.4% higher.

The ruling party has yet to announce this year’s official growth target. It has been at least 6% in previous years. Beijing looks likely to miss its target of doubling incomes from 2010 levels by this year.

Controls on Beijing, the capital, and some other cities have been tightened to prevent a resurgence of the disease. Most foreigners are barred from entering the country.

Beijing is boosting spending on a “New Infrastructure” Plan that includes next-generation telecom networks, artificial intelligence, electric vehicle charging and data centers. But leaders don’t want to pump too much money into the economy with full fledged stimulus for fear of adding to debt or pushing up inflation that is near a seven-year high.

Carrying out that infrastructure investment “will take a much longer time than it would do without social distancing in place,” said Pang of ING. “Recovery will be a long road.”