A steady rise in food and energy costs pushed overall U.S. consumer prices up 0.7 percent in May, the sharpest gain in more than 1-1/2 years, but prices that strip out volatile food and energy barely edged up, the Labor Department said on Friday.

The gain in overall prices outstripped Wall Street economists' forecasts for a 0.6 percent rise and was the largest since a 1.2 percent jump in September 2005. But more closely watched core prices increased only 0.1 percent, lower than a forecast 0.2 percent rise and down from 0.2 percent in April.

The muted core price rise was likely to reassure financial markets that price gains remain tame, notwithstanding Federal Reserve officials' warning that they still see a danger from potential inflationary pressures. "Although core inflation seems likely to moderate gradually over time, the risks to this forecast remain to the upside," Fed Chairman Ben Bernanke told a monetary policy conference last week.

The department said core prices have risen 2.1 percent on a seasonally adjusted annual rate during the first five months this year, compared with a 2.6 percent rise for all of 2006.

Energy prices climbed for a fourth straight month in May, rising 5.4 percent after a 2.4 percent April pickup. Gasoline prices soared 10.5 percent in May, more than twice the 4.7 percent increase posted in April.

Food prices were up 0.3 percent last month following a 0.4 percent gain in April. Food prices have risen at a 6.2 percent annual rate so far in 2007, nearly three times the 2.1 percent increase for all of 2006.