China’s consumer inflation rate grew at its fastest pace in six months in October as food prices rose, while producer prices accelerated to a near-five year high, exceeding expectations.

The consumer price index (CPI) rose 2.1% in October from a year earlier, compared with a 1.9% increase in September, the National Bureau of Statistics (NBS) said on Wednesday.

Analysts had expected a 2.1% gain, a Reuters poll showed.

Factory prices rose 1.2% on-year, the fastest pace since December 2011 after turning marginally positive in September for the first time in nearly five years. The reading handily beat forecasts for a 0.8% rise.

Stronger factory prices have helped boost industrial profits, relieving some pressure on companies squeezed by higher costs and weak demand.

China’s economy expanded at a steady 6.7% in the third quarter and looks set to hit Beijing’s full-year target, fueled by stronger government spending, record bank lending and a red-hot property market that are adding to its growing pile of debt.

A jump in food prices fueled faster consumer inflation in October. Food prices rose 3.7%, compared with a 3.2% gain in the previous month.

For more on China, watch Fortune’s video:

Non-food prices inched up 1.7% versus September’s 1.6% gain.

On a monthly basis, consumer prices fell 0.1%. Prices for health care rose 4.8%, the fastest-rising CPI sub-category.

China’s producer price index is expected to continue to increase year-on-year in the coming months, statistics bureau spokesman Sheng Laiyun said in late October.

“I believe PPI in the coming months will continue to show positive growth year-on-year, but it could be volatile month-on-month,” Sheng told a group of foreign reporters.