China emerged from the pandemic year with an expanding economy, making it the only major economy to report economic growth for the year.

China eked out 2.3 percent economic growth in 2020, according to official statistics released Monday.

Economies in Europe, the U.S., and Japan contracted on a year-over-year basis, although official tallies for the fourth quarter have not yet been released.

Growth in the three months ending in December rose to 6.5 percent over a year earlier as consumers returned to shopping malls, restaurants, and cinemas, official data showed Monday. That was up from the previous quarter’s 4.9 percent and stronger than many forecasters expected.

In early 2020, activity contracted by 6.8 percent in the first quarter as the ruling Communist Party took the then-unprecedented step of shutting down most of its economy to fight the virus. The following quarter, China became the first major country to grow again with a 3.2 percent expansion after the party declared victory over the virus in March and allowed factories, shops, and offices to reopen.

Restaurants are filling up while cinemas and retailers struggle to lure customers back. Crowds are thin at shopping malls, where guards check visitors for signs of the disease’s tell-tale fever.

Domestic tourism is reviving, though authorities have urged the public to stay home during the Lunar New Year holiday in February, normally the busiest travel season, in response to a spate of new infections in some Chinese cities.

In a testament to China’s strategy of dominating global manufacturing, exports have been boosted by demand for Chinese-made masks and other medical goods.

The growing momentum “reflected improving private consumption expenditure as well as buoyant net exports,” said Rajiv Biswas of IHS Markit in a report. He said China is likely to be the only major economy to grow in 2020 while developed countries and most major emerging markets were in recession.

The economy “recovered steadily” and “living standards were ensured forcefully,” the National Bureau of Statistics said in a statement. It said the ruling party’s development goals were “accomplished better than expectation” but gave no details.

2020 was China’s weakest growth in decades and below 1990’s 3.9 percent following the crackdown on the Tiananmen Square pro-democracy movement, which led to China’s international isolation.

Despite growth for the year, “it is too early to conclude that this is a full recovery,” said Iris Pang of ING in a report. “External demand has not yet fully recovered. This is a big hurdle.”

Exporters and high-tech manufacturers face uncertainty about how President-elect Joseph Biden will handle conflicts with Beijing over trade, technology, and security. His predecessor, Donald Trump, hurt exporters by hiking tariffs on Chinese goods and manufacturers including telecom equipment giant Huawei by imposing curbs on access to U.S. components and technology.

“We expect the newly elected U.S. government will continue most of the current policies on China, at least for the first quarter,” Pang said.

The International Monetary Fund and private sector forecasters expect economic growth to rise further this year to above 8 percent.

China’s quick recovery brought it closer to matching the United States in economic output.

Total activity in 2020 was 102 trillion yuan ($15.6 trillion), according to the government. That is about 75 percent the size of the $20.8 trillion forecast by the IMF for the U.S. economy, which is expected to shrink by 4.3 percent from 2019. The IMF estimates China will be about 90 percent of the size of the U.S. economy by 2025, though with more than four times as many people average income will be lower.

Exports rose 3.6 percent last year despite the tariff war with Washington. Exporters took market share from foreign competitors that still faced anti-virus restrictions.

Retail spending contracted by 3.9 percent over 2019 but gained 4.6 percent in December over a year earlier as demand revived. Consumer spending recovered to above the previous year’s levels in the quarter ending in September.

Online sales of consumer goods rose 14.8 percent as millions of families who were ordered to stay home shifted to buying groceries and clothing on the internet.

Factory output rose 2.8 percent over 2019. Activity accelerated toward the end of the year. Production rose 7.3 percent in December.

Despite travel controls imposed for some areas after new cases flared this month most of the country is unaffected.

Still, the government’s appeal to the public to avoid traditional Lunar New Year gatherings and travel might dent spending on tourism, gifts, and restaurants.

Other activity might increase, however, if farms, factories, and traders keep operating over the holiday, said Chaoping Zhu of JP Morgan Asset Management in a report.

“Unusually high growth rates in this quarter are likely to be seen,” said Zhu.

___

The Associated Press contributed to this report.