WASHINGTON (MarketWatch) — The cost of living in February rose by the fastest amount in 10 months as Americans paid sharply higher prices for gasoline, according to the latest government data.

The consumer price index jumped 0.4% last month on a seasonally adjusted basis, the Labor Department said Friday. That was slightly below the 0.5% increase forecast by a MarketWatch survey of economists.

The higher cost of consumption last month easily outstripped a 0.1% gain in hourly pay for U.S. workers. As a result, inflation-adjusted earnings fell 0.3% in February to mark the second straight decline.

The increase in the CPI stemmed mostly from 6.0% spike in the price of gasoline — the biggest jump since December 2010. That accounted for about four-fifths of the overall rise in consumer prices.

Yet the price of natural gas declined again, keeping energy costs partly in check. Overall, energy prices climbed 3.2%, the biggest increase in nearly a year.

The higher price of gas has suddenly emerged as a key issue in the 2012 presidential election. Republicans have slammed President Barack Obama’s policies as contributing to the rise in oil prices, prompting the White House to accuse them of political opportunism. See MarketWatch election page

The cost of energy — for homes and autos — eats up a good portion of consumer income and sharp spikes can cause the economy to slow. Yet it’s unclear how much prices will rise or for how long.

If gas prices don’t rise any further, the U.S. is unlikely to suffer much, economists say. Yet another big surge could squeeze the budgets of Americans and hurt the economy just like it did last spring.

Excluding energy, the cost of most consumer goods and services were little changed.

“The February CPI was relatively benign, outside of the as-expected surge in gasoline prices,” said Stephen Stanley, chief economist of Pierpont Securities.

The cost of food, for instance, was flat in February. Cereal and baked goods jumped 0.4%, but prices fell for meat, poultry, fish, eggs and dairy.

Subtracting food and energy, the so-called core rate of inflation rose a smaller 0.1%. Core CPI is viewed by the Federal Reserve as a better indicator of long-term inflationary trends because food and energy costs can see-saw from month to month.

Economists expected a 0.2% increase in the core rate.

Outside of those categories, prices also rose for housing, autos, medical care and household furnishings. The cost of shelter rose for the fifth straight month and the index for new autos posted the first increase since last June, up 0.6%.

Higher auto prices suggest that underlying demand for motor vehicles will continue to rise — a sign the economy is getting better. Until recently the auto industry had to rely heavily on discounts to boost sales.

Prices dropped 0.9% for clothing, the biggest decline in six years.

Over the past 12 months, consumer prices have risen an unadjusted 2.9%, unchanged from January.

The core rate has increased 2.2% over the past 12 months, down from 2.3% in January.