U.S. consumer prices rose in February on higher gasoline and apparel prices, government data showed on Wednesday, calming fears of deflation for now.

Core prices, which exclude food and energy items, increased 0.2 percent in February after rising by the same margin the prior month. That compared to analysts' prediction for a 0.1 percent increase.

On a year-over-year basis, consumer prices were up 0.2 percent after being flat in January. Energy prices surged 3.3 percent in February, also the largest monthly increase since July last year, while gasoline was up 8.3 percent.

However, compared to the same period last year, energy prices were down 18.5 percent, the department said.

Apparel prices jumped 1.3 percent, the biggest rise since a 1.5 percent gain in March 1990.

(Reporting by Lucia Mutikani, Editing by Andrea Ricci)