BEIJING — China’s economy has again defied President Trump’s predictions that it is in trouble, with official statistics showing it grew by a surprisingly robust 6.4 percent in the first three months of the year.

Although analysts are skeptical about Chinese data, and although the figures showed the growth was fueled largely by unsustainable government spending, the numbers underscore the resilience of the world’s second-largest economy. 

“Trump should realize this is a sign that China’s economy is not about to fall off a cliff,” said Andrew Polk of Trivium China, a consultancy.

As the United States and China edge toward a deal to end their protracted trade war, Trump has repeatedly suggested that Beijing is desperate for a deal because its economy is in trouble. By contrast, he has bragged about the United States’ improving economy and buoyant stock markets.

But the reality is not quite so black and white.

China’s National Bureau of Statistics said the economy grew by 6.4 percent compared with the first quarter of last year, maintaining the pace recorded in the previous three months. “The national economy enjoyed stable performance and growing positive factors, stronger market expectations and confidence,” bureau spokesman Mao Shengyong told reporters Wednesday. 

But he also struck a cautious note. “However, at the same time, we should also be aware that . . . the task of reform and development is arduous, and downward economic pressures still persist,” he said.

Growth in the first quarter was supported by infrastructure spending and bonds issued by local governments. The government was trying to “front-load” this spending to boost statistics, economists said.

“The latest growth numbers suggest that the government’s stimulus measures are taking hold and stabilizing growth,” said economist Eswar Prasad of Cornell University, although he warned this could create bigger financial risks for the future.

China’s industrial production grew 8.5 percent in March from a year earlier, the biggest jump in more than five years and far exceeding expectations. That suggested it was a one-off blip. 

Chinese authorities have also injected record amounts of money into the financial system to stave off the slowdown, perhaps so as not to appear weak while the trade negotiations continue. Bank loans hit a record high of $865 billion during the first quarter.

The trade war has had a relatively small effect on China’s economy. The Organization for Economic Cooperation and Development, a group of rich nations, estimates the trade war has shaved one-quarter of a percent off the growth rates in China and the United States.

Overall, it will reduce total world trade by 0.4 percent by 2020, OECD Deputy Secretary General Ludger Schuknecht said in Beijing this week.

Recent statistics, combined with murmurings about a trade deal, suggested there was reason to be more optimistic about China’s economy than even a few months ago, Prasad said.

Economists at UBS upgraded their forecast for Chinese growth this year from 6.1 percent to 6.4 percent.

During a major Communist Party meeting in March, Premier Li Keqiang set a growth target of 6 to 6.5 percent for this year. Even Julian Evans-Pritchard of the Capital Economics consultancy, who estimates the first-quarter growth rate is more likely about 5.3 percent, was relatively optimistic. “With credit growth now accelerating and sentiment improving, China’s economy will bottom out before long if it hasn’t already,” he wrote in a note. 

The surprise after Wednesday’s statistics stems from the fact that China’s economic fundamentals remain concerning.

Growth, having surged in the 1990s and 2000s, has slowed to its weakest rate in 30 years as the economy matures. Without painful structural changes, economists warn, China will start to record the kind of low-single-
digit growth rates more common in developed countries. 

But President Xi Jinping has been reluctant to embark on those changes, strengthening state-owned enterprises instead of allowing the market to operate, and relying on old-fashioned pump-priming to boost growth.

Many economists are sounding alarm bells about the debt levels in China, warning that the country is heading toward a classic banking crisis, riven with defaults and bankruptcies. The discussion in Beijing these days revolves around whether China’s crisis will be a crash like the one that afflicted Brazil or whether it will stumble into a decades-long malaise like Japan.

Chinese policymakers are unwilling to face this prospect, said one businessman in Beijing, speaking on the condition of anonymity to avoid damaging his relations with the government.

“They look in the mirror and say, ‘Aren’t we gorgeous?’ ” he said. “But in reality, they are running out of steam.” 

The OECD this week warned about the rising financial risks in China from high corporate debt. 

In its latest report on the Chinese economy, the OECD said China should avoid channeling its fiscal stimulus to state-owned enterprises and local governments. In many provinces, public debt exceeds annual revenue, sometimes by a large margin, it says.

There are other signs of stress in the Chinese economy.

Applications from overseas buyers and inquiries about the country’s largest trade fair, the Canton Fair, which starts Friday, are down this year.  

The event is considered a barometer for China’s foreign trade, so the relatively low level of interest suggested a “severe situation,” a spokesman said.

 There have also been widespread reports of job losses, especially in the tech sector but also in government-related jobs. China’s “big five” state-owned banks laid off a total of 26,700 people last year, according to local reports.