Rising food and gasoline costs lifted U.S. consumer prices overall in March, but underlying inflation pressures were contained and consumer confidence rose in April.

While consumers remained concerned about higher fuel and food prices, they saw the sharp rise in gasoline prices as temporary and longer-term inflation expectations eased.

The small rise in core inflation, excluding food and energy costs, and the moderation in long-term inflation expectations may be seen as vindication for officials at the Federal Reserve who have viewed the recent energy price spike as having a temporary effect on inflation.

The Fed is not going to see inflation as a threat so they have the freedom to keep interest rates low longer, said David Wyss, chief economist at Standard & Poors Ratings Services in New York.

But core inflation is creeping up from its lows six months ago, so the Fed is going to end its extraordinary measures, he added.

The Fed's policy-setting committee meets April 26-27 and debate is most likely to center on the timing of the withdrawal of some of the massive stimulus it has lent to the economy.

Overall consumer inflation rose 0.5 percent in March after increasing by the same margin in February.

But the core consumer price index, watched by the Fed as a guide to monetary policy, edged up 0.1 percent after gaining 0.2 percent in February, the Labor Department said. That was below economists' expectations for a 0.2 percent advance.

Year-on-year consumer prices rose 2.7 percent, the largest gain since December 2009, after increasing 2.1 percent in February.

In the 12 months to March, core CPI rose 1.2 percent year-on-year after advancing 1.1 percent in February. Fed officials, however, would like to see core inflation to 2.0 percent to prevent deflation.

U.S. stocks were flat amid disappointing results from Bank of America Corp and Google, but U.S. Treasury debt prices rallied on the inflation data.

CONSUMER CONFIDENCE ROSE

In other data, the Thomson Reuters/University of Michigan's index on consumer sentiment rose to 69.6 in early April from 67.5 in March, above expectations for a reading of 68.5.

Consumers' near-term inflation expectations were steady at 4.6 percent, but their expectations for the next five years fell to 2.9 percent from 3.2 percent.

Inflation expectations are viewed as a transmission channel for price pressures and Fed officials have said they would monitor them to ensure an inflation psychology does not become ingrained.

Higher gasoline prices still have consumers worried about inflation in the short term, but there is no evidence that medium term expectations are becoming unanchored, said Paul Ashworth, chief U.S. economist at Capital Economics in Toronto.

A separate report from the Federal Reserve showed industrial output rose 0.8 percent in March as utility production bounced back and manufacturing continued to exhibit vigor.

The strong gain in production at the nation's factories, mines and utilities pushed the percentage of industrial capacity in use up to 77.4, its highest level since August 2008, the report showed.

WEAK LABOR COSTS LIMIT PRICE RISES

Weak labor costs, which account for the bulk of a company's expenses, should keep inflation pressures contained. The Labor Department report showed real average hourly earnings fell 0.6 percent in March after declining 0.5 percent the prior month.

Last month, food and gasoline prices accounted for almost three quarters of the rise in overall consumer inflation. Gasoline rose 5.6 percent, increasing for a ninth straight month, and the index has now risen 14.4 percent over the last three months.

Food rose 0.8 percent, the largest gain since July 2008, after increasing 0.6 percent in February.

Core inflation last month was lifted by housing and transportation costs. Shelter costs, which account for about 40 percent of core CPI, rose 0.1 percent, rising by the same margin for a sixth straight month as the recovering economy boosts demand for rental apartments.

There were also increases in new and used vehicle prices, air fares and medical costs. Apparel prices fell 0.5 percent after dropping 0.9 percent in February.

(Additional reporting by Tim Ahmann)