Consumers spent more in June, but only because the things they bought cost more.

Driven primarily by energy and food prices, inflation grew 0.8 percent over May, the biggest monthly increase since September 2005, the Bureau of Economic Analysis reported on Monday. Spending, by comparison, grew just 0.6 percent in June.

“Inflation is intensifying, and that is the main source of weakness in consumer spending,” said Dean Maki, chief United States economist at Barclays.

High food and energy prices continue to drive overall prices. Without food and energy, core inflation grew at a more modest 0.3 percent over May. The prices of nondurable goods  the most current measure of food and energy prices kept by the bureau, adding in items like clothing  recorded the biggest year-over-year increase since July 1981.

Image Shoppers on Michigan Avenue in Chicago. The government said that spending grew 0.6 percent in June over May, but inflation grew 0.8 percent. Credit... Russel A. Daniels/Associated Press

Stock prices fell in response to the news, but recovered some ground before closing lower.

Oil fell $3.69, to $121.41 a barrel, partly on anticipation that struggling consumers would not be buying as much, but also on reports that a developing storm in the Gulf of Mexico would miss offshore oil operations. The Dow Jones industrial average and the broader Standard & Poor’s 500-stock index ended the trading day down slightly.