Producer prices rose for the first time in 17 months, a sign that surging materials costs may start to squeeze corporate profits.

The costs companies pay for energy and unfinished goods increased 0.4 percent in May from a year earlier after falling a revised 0.1 percent in April, the Bank of Japan said Thursday. The median forecast of 25 economists was for a 0.3 percent increase.

Emerging economies including China are boosting demand for raw materials, increasing prices for Japanese companies that are still struggling to pass on costs amid deflation at home. Consumer prices excluding fresh food fell for a 14th month in April.

"If import prices surge in Japan, someone in the supply chain must bear the burden," Yoshiki Shinke, a senior economist at Dai-ichi Life Research Institute in Tokyo, said before the report. "With consumer deflation persisting, companies can't avoid absorbing profit margin squeezes to some extent."

Producer prices rose 0.1 percent in May from April, the BOJ said.

Even so, some commodity prices have moderated recently amid concern that the European sovereign-debt crisis will curtail global growth. The BOJ's overseas commodity index, a gauge of costs of materials including oil, steel, copper and wheat, rose 20.1 percent in May from a year ago, slowing from a 64.6 percent increase in April. BOJ policymakers predicted in April producer prices will climb 1.3 percent in the year ending next March, while core consumer prices will slide 0.5 percent.