In another blow to China’s economy, credit rating agency Moody’s said on Tuesday it had issued a negative outlook for the Chinese government’s financial health.

Moody’s expressed concern about the potential cost to the national government of bailing out debt-ridden regional and local governments and state-owned enterprises. Moody’s, which previously viewed China’s finances as stable, warned that the country’s economy is settling into slower growth while its huge real estate sector has begun to contract.

China’s Ministry of Finance responded immediately, saying the Chinese economy is resilient and local government budgets could withstand the loss of revenue stemming from the country’s housing crisis.

At the same time, Moody’s reaffirmed its A1 overall credit rating for the Chinese government, which is roughly in the middle of the scale of what is considered “investment grade,” or generally low risk. A negative outlook on a credit rating is not necessarily soon followed by a downgrade, but it serves as a warning that the existing rating may not be sustainable.

However, the reduced credit outlook marks an important milestone for China’s economy.

Until recently, China had seemingly unlimited money to spend on the world’s largest bullet train network, vast military buildup, subsidies to manufacturers and extensive overseas construction projects.

Today China faces increasingly serious budget constraints, caused mainly by a sharp decline in the real estate sector. The construction of apartments, factories, office towers and other projects has been the country’s largest industry, accounting for 25 percent of economic output. Apartments are also the main investment for most households, accounting for three-fifths or more of their savings.

While China’s national government borrowing has been limited, local and regional governments and state-owned enterprises have borrowed heavily over the past 15 years. The money local governments got from lenders has generated high economic growth, but many of them are now in serious trouble.

For China, the change in credit outlook will have little direct effect on its finances. Unlike many countries, China depends very little on external debt. The national government mainly sells bonds to the country’s state banks. The country’s regional and local governments and state-owned companies also sell them bonds.

Beijing had emphasized China’s economic leadership during the global financial crisis of 2008 and 2009, when the US housing market suffered a sharp correction. Now China faces a similar and possibly greater housing crisis. Dozens of large property developers are insolvent and unable to complete hundreds of thousands of apartments for which they had already accepted large deposits.

Developers have left hundreds of billions of dollars in overdue invoices to small businesses and other contractors, triggering a cascade of payment problems. With the exception of a few state-owned companies, most developers have stopped purchasing land for future housing construction.

Land sales had been the main source of income for local governments. Many of them are now facing a crisis because their income from these sales has plummeted. In its statement on Tuesday, Moody’s said the national government will likely have to help these governments deal with the situation.

Difficulties in the real estate sector have slowed economic growth, contributed to high youth unemployment and left many families wary of spending money.

“The change in outlook also reflects increased risks related to structurally and persistently lower medium-term economic growth and the ongoing downturn in the real estate sector,” Moody’s said.

China’s Ministry of Finance rejected Moody’s arguments. He said that while local governments’ revenue from land sales had fallen, the same governments were also spending less to compensate residents whose homes were demolished to make way for new buildings. The ministry also stated that China’s economy still has considerable momentum.

China is not the only one on the receiving end of Moody’s concerns. The agency downgraded its credit outlook for the United States to negative last month, while reaffirming the country’s top-level AAA rating.

Overall debt is now higher in China, relative to the size of its economy, than in the United States.

The last time Moody’s and S&P Global Ratings downgraded China’s credit rating was in 2017. More recently, S&P has expressed less concern than Moody’s about China’s economy. Several hours before Moody’s announcement on Tuesday, S&P said it believed China could avoid replicating Japan’s “lost decade” of weak economic activity following its housing crisis in the early 1990s.

Fitch Ratings told Bloomberg Television earlier this year that it might reconsider the credit rating on China’s sovereign bonds, but recently affirmed that rating with a stable outlook.

The Chinese economy has endured a bumpy climb this year after nearly three years of strict “zero Covid” measures, including many of the world’s longest and strictest municipal lockdowns.

The economy grew at an annual rate of 5.3 percent from July to September. A debt-driven surge in manufacturers’ investments and fairly robust spending on restaurants and hotels offset a drop in apartment construction.

Data for October and November has been mixed. Investment remains strong in new factories making electric cars and other advanced products. But the arrival of the cold has caused a wave of respiratory illnesses in much of China, initially among children but also among adults. This has emptied many restaurants and other establishments in the service sector.

Moody’s said the enormous size of the Chinese economy, which is the second largest in the world after the United States, gave it considerable capacity to absorb shocks. The Ministry of Finance agreed, saying that “positive long-term fundamentals have not changed and will remain an important driver for global economic growth in the future.”