BEIJING (Reuters) - China's economic activity slowed in July, with investment growing at its slowest pace since the turn of the century, as the world's second-largest economy grappled with the painful restructuring of its older industrial sectors.

The weaker-than-expected data covering investment, lending, retail spending and factory output on Friday follows a run of poor numbers this month, keeping alive hopes the government will unleash more stimulus this year to meet ambitious economic growth targets.

"In light of persistent headwinds from the external sector, weak business sentiment, and a cooling property market, we believe that policymakers need to accelerate policy easing and reforms," Jing Li, an economist at HSBC, wrote in a note.

The increased stimulus hopes cheered investors, with China's blue-chip CSI300 Index <.CSI300> ending at it highest close since early January.

China's pace of fixed-asset investment slipped to 8.1 percent in January-July, the weakest growth since December 1999, and down from 9 percent in the January-June period. Analysts had expected it to rise 8.8 percent.

The retreat was led by a 22.9 percent decline in mining, suggesting the government's goal of cutting production in older industrial sectors is working.

China's investment and net exports are slowing, with the government increasingly expected to boost headline growth through fiscal policies rather than interest rate cuts, analysts say.

Investors remain wary about the growth outlook amid painful reforms in the state-owned enterprise sector. Private investment, which accounts for about 60 percent of overall investment, grew 2.1 percent, compared with 2.8 percent in the first half. Meanwhile, growth in investment by state firms cooled to 21.8 percent Jan-July from 23.5 percent.

The property sector, one of the few bright spots in China's economy, also showed signs of struggle with real estate investment growth slowing to 5.3 percent from 6.1 percent.

The worsening investment trend was also seen in bank lending numbers with central bank data on Friday showing a slump in new yuan loans.

Chinese banks extended 463.6 billion yuan in new loans in July, the lowest in two years and well below analysts forecasts of 800 billion yuan, as credit demand from private businesses slowed significantly and tighter property investment rules weighed on mortgages demand.

Sheng Laiyun, a spokesman at the National Bureau of Statistics (NBS), said while companies from emerging sectors are willing to invest, some private firms still struggle to access financing.

Consumption softened with retail sales growth easing to 10.2 percent after a rise of 10.6 percent the prior month and factory output rose 6.0 percent in July from a year earlier, below the 6.1 percent analysts had expected.

Slowing growth in industrial production continued, partially due to the significant restructuring of traditional industries and also because of high summer temperatures and recent flooding, NBS analyst Jiang Yuan said.

"People are worried about a lack of solid demand over the next few years so they aren't really investing, especially in capex, which is the driving factor of the slowing investment," said Zhou Hao, Senior Emerging Markets Economist at Commerzbank in Singapore.

Total social financing, a broad measure of credit and liquidity in the economy that also includes off-balance sheet forms of financing, fell to 487.9 billion yuan in July from 1.63 trillion yuan in June.

Meanwhile, central bank money supply data showed businesses were opting to sit on cash rather than invest it, raising concerns a "liquidity trap" is forming in China.

Growth in M1 money supply, which includes cash and short-term deposits, accelerated to 25.4 percent from a year earlier while M2 money supply, which includes longer-term deposits, grew only 10.2 percent, its weakest growth in 15 months.

(Reporting by Sue-Lin Wong, Elias Glenn and Chen Yawen; Writing by Sue-Lin Wong; Editing by Sam Holmes)