U.S. consumer prices rose in line with expectations in November on a surge in energy costs, but prices were flat, excluding food and energy, a government report showed on Wednesday.

The Labor Department said its Consumer Price Index leaped 0.4 percent on a seasonally adjusted basis after an unrevised 0.3 percent gain in October. A 4.1 percent burst in the energy index led the rise, as gasoline, electricity, fuel oil, and natural gas prices rose.

Prices rose 1.8 percent over the last 12 months, as expected, the first year-over-year gain since February. Core prices rose 1.7 percent over the 12-month period.

(Reporting by Mark Felsenthal; editing by Jeffrey Benkoe)