Producers are slowly passing on high energy prices to consumers, data showed on Wednesday, in a trend that raises consumer inflation risks and reinforces the case for gradual European Central Bank rate rises.

Indirect effects from past oil shocks are no longer speculation but a reality, said Luigi Speranza, economist at BNP Paribas.

Industrial producer prices in the 12 countries using the euro rose 0.2 percent month-on-month for an annual gain of 5.8 percent, European Union statistics agency Eurostat said.

The monthly rise was in line with expectations of economists polled by Reuters and the annual gain was just above consensus of 5.7 percent.

Unless absorbed by intermediaries, producer price rises are eventually passed on to consumers, raising headline inflation, which the ECB wants to keep below but close to 2.0 percent.

Since December the ECB has increased its main rate by a quarter percentage point every three months, taking it to 2.75 percent in June. Markets expect the bank to raise rates again on Thursday and then twice more in October and December for a year- end cost of credit of 3.5 percent.

The ECB will say there are upside price risks according to this data and it supports the idea that interest rates should go up gradually, said Edward Teather, economist at UBS.

Year-on-year the rise in producer prices was fuelled mainly by energy, which was up 15.7 percent and prices of intermediate goods rising 5.2 percent.

But price rises of capital goods, durable and non-durable consumer goods all accelerated in annual terms since the start of the year.

Excluding energy, producer price inflation accelerated to 3.0 percent in June from 2.7 percent in May, 2.2 percent in April, 1.8 percent in March and 1.7 percent in February.

It fits in with survey evidence suggesting companies are regained pricing power against a backdrop of stronger growth and are therefore able to pass higher input costs along the price formation chain, Speranza said.

(Additional reporting by Marcin Grajewski)