Consumer prices rose faster than expected in July as gasoline rebounded sharply, but a moderation in underlying price pressures backed the Federal Reserve's view of a low inflation environment.

The Labor Department said its Consumer Price Index increased 0.5 percent, the largest gain since March, after falling 0.2 percent in June. Economists polled by Reuters had expected a 0.2 percent rise last month.

Gasoline, which rose 4.7 percent after falling 6.8 percent the prior month, accounted for about half of the rise in CPI last month.

Core CPI -- excluding food and energy -- rose 0.2 percent after rising 0.3 percent in June. Last month's gain was in line with economists' expectations.

The Federal Reserve last week promised to keep interest rates near zero at least until mid-2013 to boost growth and said the outlook for inflation over the medium-term was subdued.

Data on Wednesday showed wholesale prices, excluding food and energy, rose at their quickest pace in six months in July, with the year-over-year increase the largest since June 2009.

Given limited pricing power for producers as consumers grapple with a 9.1 percent unemployment rate, inflation is not regarded as a threat now for an economy which barely grew in the first half of the year.

Food prices rose 0.4 percent after increasing 0.2 percent in June, also contributing to the large gain in the CPI rate.

Core consumer prices last month were held back by new motor vehicle costs, which were unchanged after five straight months of hefty gains. This likely reflects an improvement in supplies as disruptions caused by the March earthquake in Japan fade. Motor vehicle production rebounded sharply in July.

In the 12 months to July, core CPI increased 1.8 percent -- the largest increase since December 2009. This measure has rebounded from a record low of 0.6 percent in October and Fed would like to see that closer to 2 percent.

Overall consumer prices rose 3.6 percent year-on-year, rising by the same amount for a third straight month.

(Reporting by Lucia Mutikani, Editing by Andrea Ricci)