The continued pick-up in inflation comes as figures on Tuesday revealed a surge in imports and exports fuelled by demand for tech components and machinery.
The consumer price index (CPI), a key measure of inflation, came in at 1.2 percent last month, according to the National Bureau of Statistics (NBS), the same as April and just slightly lower than the forecast in a Bloomberg survey of economists.
It remained far below the government's two-percent target for the year.
On a monthly basis, CPI dipped 0.1 percent month-on-month, reversing a 0.3 percent rise in April, "mainly due to changes in energy and service prices", NBS statistician Dong Lijuan said in a statement.
He said the "12.6 percent rise in domestic gasoline prices from the previous month turned into a 0.3 percent decrease". That, he added, saw energy prices dip 0.1 percent in May, compared with a 5.7 percent jump in April.
The producer price index, which measures wholesale inflation, hit 3.9 percent -- up from 2.8 percent in April and in line with Bloomberg's forecast.
The figure marked the quickest pace since July 2022, when the PPI came in at 4.2 percent.
The gauge had been in negative territory since that October and did not reverse until March this year.
The steady rise was due to "factors such as increased demand in some domestic industries and the transmission of fluctuations in international commodity prices", said Dong.
"The acceleration of electrification, the deep integration of artificial intelligence in various fields, increased demand for computing power among others have driven up prices in... computing-related industries."
Zhiwei Zhang, president and chief economist at Pinpoint Asset Management, tied China's future export growth to the growing AI sector.
"As the momentum of the AI boom is likely to continue in the foreseeable future, China's export growth and PPI inflation will likely stay strong as well," Zhang said.