* May PPI +4.1 pct y/y vs poll +3.9 pct, April +3.4
* May CPI +1.8 pct y/y vs poll +1.8 pct, April +1.8
BEIJING, June 9 (Reuters) - China's producer inflation picked up for the second month in a row in May, buoyed by stronger commodity prices, suggesting the world's No.2 economy has retained growth momentum despite curbs on pollution and rocky trade relations with the United States.
Annual consumer inflation held steady in May from the previous month, as food prices remained largely stable, official data also showed on Saturday.
The producer price index (PPI) rose 4.1 percent in May from a year earlier, compared with an acceleration to 3.4 percent in April, according to the National Bureau of Statistics (NBS).
On a month-on-month basis, the PPI rose 0.4 percent in May, compared with a 0.2 percent decline in April.
Analysts polled by Reuters had expected May producer inflation would pick up to 3.9 percent bolstered by a recent jump in global commodity prices.
Raw material prices jumped 7.4 percent in May from a year earlier, compared with a 5.7 percent increase in April.
The higher factory-gate inflation helped to ease concerns of slowing momentum in the economy as the authorities implement tougher pollution controls on "smokestack" industries and cash-strapped regional governments cut back on big investment projects, curbing demand for building materials.
The rise could also provide a lift to earnings. Chinese industrial firms' profits rose at their fastest pace in six months in April, with earnings for iron and steel processing firms jumping 260 percent.
The consumer price index (CPI) rose 1.8 percent from a year earlier, in line with expectations which were unchanged from April's gain of 1.8 percent.
On a month-on-month basis, the CPI declined 0.2 percent.
The core consumer price index, which strips out volatile food and energy prices, rose 1.9 percent in May, down from 2.0 percent in April.
The food price index rose 0.1 percent from a year earlier, after rising 0.7 percent in April. Non-food prices rose 2.2 percent, compared with 2.1 percent growth a month ago.
With China's inflation now hovering at a stable level, tense trade conflict between the world's two economic heavyweights are fuelling worries over upward pressure on the country's consumer price index.
Agriculture products in particular could jump if Beijing followed through with its threat to impose tariffs on imports from the United States. That would lead to further upward pressure on pork prices, which have a large weighting in the consumer inflation basket.
But analysts believe inflation is already past its peak as higher borrowing costs and a cooling property market dampen underlying price pressures. April economic data had shown signs of slowing momentum as investment growth touched a near 20-year low and retail sales growth weakened.
An official think tank last month forecast consumer inflation of around 2 percent and expected producer price inflation would pick-up to about 3.8 percent in the second quarter from a year earlier.
China has set an inflation goal of 3 percent for 2018, the same target as last year.
There have also been signs that policymakers have moved to a slightly looser stance as they look to ensure growth doesn't slow too much, while also keeping financial risks under control.
China's central bank injected hefty funds via one of its liquidity operations this week as more Chinese companies are concerned about tightening credit conditions. Analysts believe the move may possibly push back the timing of another expected cut in banks' reserve requirement ratios (RRR). (Reporting by Lusha Zhang, Stella Qiu and Philip Wen; Editing by Tom Hogue)