However you slice and dice it, a sizeable chunk of China's local government debt will likely go bad over the next few years. But that will not be anything the world's second-largest economy can't muddle through.

Something of a war of words has emerged over just how much China's provincial and city governments owe their creditors for the infrastructure and other projects they have rushed out over the past several years, helping their own economies flourish amid a global downturn.

Moody's last week issued a report saying an estimate by the country's audit office a week before had underestimated local government debt by some 3.5 trillion yuan ($540 billion).

The audit office this week spoke out in its own defense, saying doubts over its figures - which put such debt at 10.7 trillion yuan -- were irresponsible.

The stakes, of course, are high.

Any wave of defaults big enough to destabilize the country's major banks or crimp the government's finances could have devastating consequences not only for the Chinese economy, but for global growth and financial markets as well.

The reality, however, is that China has significant flexibility and fiscal firepower to fend off the risks of such a shock to its economy, and will therefore probably be able to cushion the blow.

Yes, there are going to be substantial losses from local government debt. But it's not going to happen immediately, all of a sudden, all together, said Tao Wang, an economist with UBS in Hong Kong.

RUSH TO RESTRUCTURE

Analysts agree that a significant amount of local government debt, much of it taken on by so-called local government financing vehicles (LGFVs), will eventually go bad, as some of the highways and other projects they were used to fund fail to generate enough income to repay the loans.

Wang estimates 2.5 to 3 trillion yuan in local government debt will turn sour; Standard Chartered expects at least 4 to 6 trillion yuan in loans from LGFVs will not be paid back.

But the risk of a crisis big enough to throw the economy off track depends largely on the concentration of such defaults, as well as the central government's ability to step in to help without putting its own finances into jeopardy.

On both counts, China appears well equipped to weather what is sure to be a bumpy patch ahead.

First, any of the financing vehicles that start to run into trouble repaying their interest or principal are most likely to find their creditors -- together with local regulators -- willing to work out deals to restructure the debt rather than let it be counted as non-performing.

Local media have reported that a number of such entities, including one in Shanghai, have already begun to restructure some loans, pushing them onto longer maturities.

Such reports are likely to continue to dribble out over the coming months as some of the loans originally taken out to support projects that were part of the government's massive stimulus program in 2008-2009 start to come due.

However, for now at least, that should not prompt any widespread impact on banks' balance sheets, analysts say. Indeed, officials will be keen to avoid any signs of instability in the run-up to the Communist Party's next congress next year, at which major leadership changes will be finalized.

They will do everything they can to make sure that nothing goes wrong before that, said Victor Shih, a political economist at Northwestern University who has followed local government debt issues extensively.

FISCAL FIREPOWER

Even in the worst case scenario, banks' non-performing loan ratio will rise to just over 4 percent this year, declining thereafter, according to Peking First Advisory, an independent research house in Beijing.

That would be a painful jump from just over 1 percent at the end of 2010, but nothing compared with the double-digit proportion of bad loans in the late 1990s and early 2000s, before the government bailed out the major lenders and restructured them ahead of stock market listings.

When defaults do start to happen, it is likely that the central government will step in to help ease a significant portion of the burden, many analysts say, as banks and local governments will argue that much of the lending took place on Beijing's orders.

Sources told Reuters in May that regulators were looking to potentially shift 2 to 3 trillion yuan of debt off of local governments to try to ease the potential impact on banks.

The Finance Ministry has strong enough finances to do so, meaning the problem will probably be manageable, as the government has repeatedly insisted is the case.

China is targeting a budget deficit of just 2 percent of gross domestic product this year, and outstanding finance ministry debt is around 17 percent of GDP.

Even counting debt from policy lenders, local governments and entities such as the railways ministry, total public debt appears manageable, especially considering continuing economic growth will help lower the debt-to-GDP ratio, Stephen Green with Standard Chartered in Hong Kong wrote in a recent report.

China is not badly placed -- and certainly not badly enough placed to warrant all the talk of 'imminent collapse' that has been filling the airwaves, he wrote.

NEED FOR REFORM

Still, that does not mean Beijing is in the clear entirely.

Any policy missteps that would lead to a serious fall in property prices could erode the value of land, which is the collateral put up by many local investment vehicles for their loans, noted Dong Tao with Credit Suisse in Hong Kong.

Further, long-needed fiscal reforms will need to take place if Beijing is to avert a bigger problem in future.

At the root of the problem is a mismatch between local and central governments' revenues and expenditures, whereby much tax revenue is channeled to central coffers but local governments are expected to pay for many of the public works projects that Beijing promotes, sending them in search of funding.

There are constantly new policy initiatives which require local governments to form new LGFVs to raise money, said Shih, citing the push for social housing as the latest example.

The one thing the Chinese government needs to do is not give local governments so many unfunded mandates which force them to borrow more to pay for them.

(Additional reporting by Langi Chiang in Beijing; Editing by Kim Coghill)