China's July food prices jumped 9.1% from a year ago, data from the National Bureau of Statistics showed on Friday, as the country battles soaring pork prices amid the spread of African swine fever.

In particular, pork prices rose 27% from a year ago in July while fresh fruit prices rose 39.1%, the data showed.

The July figures follow an 8.3% year-on-year jump in June. Non-food items in July were 1.3% higher, government data showed.

Chinese fruit supply has been hurt by severe weather that hurt crop production this year, sending prices of apples up sharply. China is the world's largest producer and a major consumer of the staple fruit.

The official inflation data came after China confirmed Tuesday it will be suspending imports of agricultural products from the U.S. in response to President Donald Trump's new tariffs.

U.S. exports of fruits to China have already been falling in the last year with fresh fruit exports falling to $123 million from July 2018 to June 2019 — down by about half from $239 million the previous year, data from the U.S. Department of Agriculture (USDA) showed.

The USDA said in a June report that the U.S. remained China's top Northern Hemisphere supplier for apples even with a 50% tariff on the import of the fruit.

Overall, China's Consumer Price Index (CPI) rose 2.8% from a year ago in July, slightly higher than the 2.7% analysts in a Reuters poll had expected.

"Surging pork prices continued to push up consumer price inflation," said Julian Evans-Pritchard, senior China economist at Capital Economics. But "weakening demand dragged producer price inflation into negative territory last month," he wrote in a Friday note.

Producer Price Index fell 0.3% in July from a year ago, compared to the 0.1% decline analysts in the Reuters poll had expected.

That was the first time China's PPI — a gauge of corporate profitability — fell in three years, adding to concerns of deflationary risks in the world's second largest economy.

This comes as China and the U.S. continue to be locked in a prolonged tariff battle that has dragged on for more than a year. Both countries have slapped additional levies on billions of dollars worth of each other's goods, and the escalating tensions have spooked world markets and hurt the global economic outlook.

With accelerating consumer prices and the return of falling producer prices, "the upshot is that China faces the worse of both worlds," wrote Evans-Pritchard.