An employee works on an assembly line producing Mercedes-Benz cars in Beijing, August 31, 2015.

China's producer price inflation accelerated more than expected to a four-month high in August, fueled by strong gains in raw materials prices and pointing to strong, sustained growth for both factory profits and the economy.

Consumer inflation also quickened more than forecast to a seven-month high, amid signs that upstream price gains are trickling through, but analysts said price gains remain modest and there is little pressure on the central bank to tighten policy further.

"The unexpected rise in both CPI and PPI suggests that there is little hope China's monetary policy could see some relaxation before the end of this year," Zhou Hao, a Singapore-based analyst at Commerzbank.

"We believe that the market has underestimated the inflationary pressure facing China's economy, although inflation is unlikely to surge in the foreseeable future. That said, onshore rates are still on the rise," he said, referring to higher financing costs.

China's producer price index (PPI) rose 6.3 percent in August from a year earlier, from 5.5 percent in July, the National Bureau of Statistics said on Saturday.

Analysts polled by Reuters had expected producer inflation would edge up to 5.6 percent, its first pickup in six months.

On a month-on-month basis, the PPI rose 0.9 percent.

The price data added to a long list of upside surprises for the world's second-largest economy this year, which has so far defied analysts' expectations of a slowdown.

A year-long, government-led construction boom, a resilient property market and a recovery in exports have offset the expected drag from a regulatory crackdown on riskier types of financing, which is slowly driving up borrowing costs.

"The pickup in PPI shows that demand remains steady, and we expect third-quarter economic growth to remain steady from the first half," said Zhang Yiping, an economist at Merchants Securities in Shenzhen.

With the industrial sector in high gear, the economy grew by a faster-than-expected 6.9 percent in the first six months of the year.

If activity remains relatively solid in coming months, China's economic growth could accelerate for the first time in seven years in 2017. Last year's pace of 6.7 percent was the slowest in 26 years.