The previous month's reading on annual inflation was 5%.
The July increase matched the 5.6% level in January 1991, when the Persian Gulf War was raging.
"It's obviously disturbing - it's a bad number," said David Wyss, chief economist for Standard & Poor's.
The report from the Bureau of Labor Statistics is the latest sign of economic misery for Americans, on top of mounting job losses and the imploding home market.
On a monthly basis, the Consumer Price Index jumped by 0.8% in July. That is twice the increase that economists had expected.
The biggest culprit in driving up inflation was the cost of energy, which increased by 4% on a monthly basis and 29.3% annually.
The big hits on energy include a 61.1% annual surge in household fuel oil and a 37.9% jump in the price of gasoline.
Monthly food prices increased 0.9% and 8.4% annually. This is one of the largest monthly increases of the year, matching the 0.9% increase in April.
Among the annual food price increases were a 12% jump in the price of cereal and bakery products and a 10.1% increase in fruits and vegetables.
The so-called core CPI, which excludes the volatile food and energy prices, increased to 2.5% annually and 0.3% on a monthly basis in July. Analysts had expected a monthly increase of 0.2%.
Wyss said that while energy prices have dropped dramatically in recent weeks, "this is a number that is going to make the Fed very concerned."
He also said that the weak U.S. dollar was "part of the problem" in driving up the CPI.
Wyss said he does not expect the Federal Open Market Committee, which next meets on Sept. 16, to change the federal funds rate from its current target of 2%.
The price of crude oil slipped 56 cents on Thursday morning to $115.44 a barrel, down from the July 11 record of $147.27.
But Lakshman Achuthan, managing director of the Economic Cycle Research Institute, believes the worst of inflation's sting is over.
Inflation is being driven by food and energy prices, and consumers are pulling back on purchases, Achuthan said. He said this is partly why the price of new vehicles has fallen 0.8% over the last year, while the price of computers and computer equipment has plunged 11.8%.
"Inflation is not going to run away; it's going to be reduced," he said. "The bad news is that this is because we're in a recession. Recession kills inflation."