Inflation rose 7.7% for the year ending October, a smaller-than-expected increase signaling the economy may be cooling, a Labor Department report showed Thursday.

Analysts had forecast the October Consumer Price Index to hit 7.9%. U.S. stocks soared on the results. The technology-heavy Nasdaq Composite Index rocketed more than 5% in early trading. The Dow Jones Industrial Average shot up more than 800 points.

The CPI measures the costs of goods and services. The CPI recorded an 8.2% increase for September, a 42-year high.

Core CPI, which excludes food and energy, increased 6.3% for October, down from 6.6% the month before.

The Federal Reserve has hiked interest rates seven times this year to stifle inflation. Federal Reserve chairman Jerome Powell said it's likely the central bank will continue increasing rates into 2023.

Nonetheless, the October CPI was widely viewed as showing a slowing economy.

A 2.4% decline in used vehicle prices, for instance, shows "that inflation has begun to moderate from the extreme levels of the past few months," Rick Rieder, BlackRock's chief investment officer of global fixed income, wrote in a note to clients.