China's economic growth held steady in the quarter ending in September as trade weakened but consumer spending rose.

The economy expanded by 6.7 percent compared with a year earlier, the government reported Wednesday. That was in line with the two previous quarters and better than some forecasters expected.

Exports have contracted this year due to weak global demand but data showed retail sales grew 10.4 percent in the first three quarters of the year, up 0.1 percentage point from the first half.

"The general performance was better than expected," said a government statement.

Growth has declined steadily over the past five years as Beijing tried to steer China to a slower, more self-sustaining expansion based on domestic consumption instead of trade and investment.

An unexpectedly sharp slowdown over the past two years prompted fears of politically dangerous job losses. Beijing launched mini-stimulus measures with higher spending on construction of highways and other public works.

State media have warned China's economic outlook will be "L-shaped," meaning the downturn should bottom out but growth will not rebound to the double-digit rates of the past decade.