Output rose 6.9 percent in the three months ending in June from a year ago

China’s economic growth held steady in the latest quarter, boosted by unexpectedly strong trade and consumer spending, despite fears tighter lending controls aimed at cooling a surge in debt are weighing on commercial activity.

Output rose 6.9 percent in the three months ending in June from a year ago, data showed Monday. That was in line with the previous quarter and better than many forecasts.

Communist leaders are eager to keep growth steady as they head into a ruling party congress at which President Xi Jinping is due to be reappointed as leader later this year. But the economy faces headwinds as Beijing clamps down on lending to rein in a surge in debt that has fueled fears it might harm the financial system or drag on growth.

Forecasters expect the economy to cool as those controls depress investment, the biggest component of growth in recent years.

“The economy appears to have ended Q2 on a strong note,” said Julian Evans-Pritchard of Capital Economics in a report.

“This strength seems unlikely to last, however,” he wrote. “The recent crackdown on financial risks has driven a slowdown in credit growth, which will weigh on the economy during the second half of this year.”

The International Monetary Fund has forecast China’s full-year growth for 2017 to hold steady at last year’s level of 6.7 per cent. The IMF raised its outlook twice this year, citing strong government spending. The government’s growth target is 6.5 percent “or higher if possible.”

Consumer spending and trade growth both accelerated during the second quarter, helping to offset softening investment in factories, real estate and other fixed assets.

Retail sales rose 10.4 per cent in the first half of the year, up 0.1 per cent points from the first quarter’s rate, according to the National Bureau of Statistics. Factory output rose 6.9 per cent in the first half, up 0.1 per cent points from the first quarter rate and 0.9 percentage points better than the same time last year.

Trade data released earlier showed export growth accelerated in May and June, at least temporarily averting concern about possible politically dangerous job losses in trade-related industries that employ millions of people.

Investment rose by 8.6 per cent in the first half of the year, but that was down from 0.6 per cent from the first quarter’s expansion. Private sector analysts cite surging debt as the biggest potential risk to China’s long-term economic stability.