BEIJING — China’s economy has recovered rapidly from coronavirus shutdowns and has started to grow again, figures showed Thursday, leading analysts here to crow that the country was best-in-class at dealing with the pandemic.

This was clearly a dig at the United States — where the virus is spreading aggressively and the economy is suffering — though China’s statistics are often thought to be massaged for political reasons.

Indeed, President Xi Jinping said in a letter released Thursday that China was dealing with the pandemic and making progress on his top two economic goals. China is “striving for a decisive victory in building a moderately prosperous society in all respects and eradicating poverty,” Xi wrote, according to the official Xinhua News Agency.

While China faces challenges in reviving its domestic economy and in its virus-stricken export markets, Thursday’s data showed a speedy improvement from the depths of February.

The world’s second-largest economy contracted by 6.8 percent in the first three months of the year, the worst quarterly figure since 1992, as the coronavirus that spread from Wuhan brought industry to a halt and forced tens of millions of people to remain indoors.

Economists had anticipated 2.4 percent expansion in the second quarter, but China’s National Bureau of Statistics defied the forecasts, announcing that growth had hit 3.2 percent between April and June.

“China’s V-shaped economic recovery continued for a fourth consecutive month in June, led by strong domestic demand,” said Andy Rothman, an American economist known for his bullish views on China. “If covid-19 remains under control, China can remain the world’s best consumer story.”

Growth of 3.2 percent is a far cry from the 6.1 percent annual pace recorded last year — a rate of 6 percent is thought to be the threshold between the politically tolerable and intolerable — but is still a sharp improvement on the first quarter.

Life in most parts of China has regained a semblance of normality, although temperature checks are required at most buildings and nearly everyone wears a mask. Many stores and services require proof of a clean bill of health — as evidenced through a smartphone app — before they will allow customers to enter.

As if to underscore success, the state-run China Film Administration said Thursday that almost all movie theaters could open on Monday after a near-six-month closure.

But the statistics bureau warned that the outlook for China, which depends on trade with countries still battling the virus or entering recession, is far from rosy.

“At the moment, the global epidemic is still spreading, the great impact of the epidemic on the world economy will continue to evolve, external risks and challenges have increased significantly, domestic economic recovery remains under pressure,” spokeswoman Liu Aihua told reporters.

The International Monetary Fund projects that the world economy will contract by 4.9 percent this year.

Furthermore, swaths of China have been inundated this month in the worst floods in two decades, with about 29,000 homes destroyed and at least 141 people killed, according to state media. Economic losses have topped $12 billion, and more rains are expected.

Still, Julian Evans-Pritchard, senior China economist at Capital Economics, said that with jobs and spending returning, and the government trying to stimulate growth, the outlook was good.

“The recovery will inevitably slow down during the second half of the year now that the initial boost from reopening has passed,” he said in a note to clients. “But … we think GDP will return to its pre-virus trend by the end of the year, faster than in any other major economy.”

China’s property market has shown surprising resilience, economists said, and exports have picked up as factories resume production. But in the service sector, which constitutes about 60 percent of China’s economy, output remains just below pre-virus levels.

Economists were buoyed by the jobs data in particular. The surveyed unemployment rate slipped to 5.7 percent and is now only a sliver higher than at the end of last year.

The China Film Administration said Thursday that movie theaters could reopen Monday, though strict social distancing rules would strip the moviegoing experience of many of its pleasures.

Many production companies release their potential blockbusters around the Lunar New Year holiday, when most people are off work and the weather is cold. But this year, the virus outbreak coincided with the holiday, which began Jan. 24, forcing 70,000 screens to go dark at what should have been the year’s biggest box-office week.

A few hundred theaters briefly reopened, but most have remained shuttered. Wanda Film, China’s largest movie theater chain, this week said it expected to have lost about $220 million in the first half of the year.

Starting Monday, temperatures will be checked and people with fevers will not be allowed in. Those admitted will have to wear masks and sit three feet apart, with theaters below 30 percent capacity. Concession stands will be closed and no eating or drinking will be permitted, the authority said.

Still, only a handful of theaters — those in Beijing’s Fengtai district, near a market that experienced a recent outbreak — would remain closed.