China's economy expanded at a slower pace in the second quarter as Beijing's efforts to contain debt hurt activity and as the world's number two economy faces an escalating trade fight with the US.

Meanwhile June factory output growth weakened to a two-year low in a worrying sign for investment and exporters as a trade war with the US intensified. 

The world's second-largest economy grew by 6.7% in the last quarter year-on-year - matching expectations.

It and looks set to meet the official 2018 growth target of around 6.5%, though the trade row with the US, a slowing property market and lower shipments have sharply increased the risks to the outlook. 

The second quarter GDP figure was slightly below the first quarter's 6.8%, the National Bureau of Statistics said, with net exports making a dent on overall first half economic growth. 

As the trade tussle with Washington shows no signs of ebbing and the external sector continues to weigh on China's economy, more timely monthly activity data indicated growth was slowing at a faster pace going into the second half of the year. 

First-half fixed asset investment growth was a record low, while industrial output for June matched the slowest growth rate in over two years at 6% and missed forecasts of a 6.5% expansion rate. 

The data added to concerns about the impact from the Sino-US trade war on economic growth in China and the rest of the world. 

On a quarterly basis, growth in China picked up 1.8% from 1.4% in the first quarter, beating expectations of 1.6% growth.

China's economy has already felt the pinch from a multi-year crackdown on riskier lending that has driven up corporate borrowing costs, prompting the central bank to pump out more cash by cutting reserve requirements for lenders. 

Data on Friday showed China's exports grew at a solid pace in June, though analysts suggest front-loading of shipments ahead of tariffs taking effect may have boosted the figures. 

The administration of US President Donald Trump has raised the stakes in its trade row with China, saying it would slap 10% tariffs on an extra $200 billion worth of Chinese imports. 

That threat came only days after both countries slapped tit-for-tat tariffs on $34 billion worth of each other's goods. 

The Chinese property market, one of the economy's key drivers, also slowed, as property investment posted its weakest growth in six months in June, with sales also cooling. 

Faced with a slowdown in domestic demand and the trade war risks, Chinese policymakers have started to step up policy support for the economy and have softened their stance on deleveraging.

China is looking to consumer spending to drive the economy as it rebalances away from government-driven investment and the export sector, but the evidence in the first half was less encouraging than headline statistics suggested. 

Final consumption contributed 78.5% of first half growth, compared to 63.4% the same time last year, and higher even than in the first quarter, when spending typically peaks due to the influence from the Chinese New Year holiday. 

But that data also includes government spending and is pushed up when net exports are a negative factor as they have been this year. 

Retail sales growth picked up in June from May, but year-to-date growth is down to 9.4% from 10.4% in the first half of last year. The surveyed jobless rate in June was unchanged from May at 4.8%. 

While economists are generally sanguine about China's slower growth trajectory, many are wary of the risks to the outlook from the escalating trade dispute with the US. 

Commenting on today's figures, Garret Grogan, Global Head of Trading at Bank of Ireland Global Markets, said the composition of the GDP data shows a continued rebalancing away from investment and exports towards consumption.

He said this trend will be expedited by policy makers going forward until clarity returns to the broader global trade framework - which he expects after the US mid-term elections. 

"Indeed retail sales data overnight is indicative of this recent trend, which shows broad confidence in the domestic economy despite the ongoing tensions related to international trade," Mr Grogan said.

But looking at the bigger picture, the momentum of the Chinese economy is clearly showing signs of slowing as the governments structural deleveraging campaign and the escalation of the US trade war are expected to manifest in the third and fourth quarters of this year. 

"Market attention will now turn to the upcoming Chinese Government Politburo meeting for a clearer message on policy fine tuning, and the all-important outlook for the yuan," he added.