The Federal Reserve may decide to scale back the size of its upcoming interest-rate hikes after inflation figures in July were less than expected.

The S&P 500 ended a four-session losing streak and hit its highest level in five months. The Bureau of Labor Statistics said headline inflation increased to 8.5% in the year through July. The June rate was slower than the one in June, but it was still better than the one in July.

Excluding food and energy prices, the core inflation rate was unchanged. The month-over-month increase in July was less than in June.

The Fed is expected to deliver a rate hike of 50 basis points in September, rather than a larger increase of 75 basis points, according to investors.

"Inflation data is coming off higher levels, but it's still running at a worryingly high rate," Rick Rieder said in a note.

The US index was at 4:00 p.m.

Rieder said that the Federal Reserve's hiking cycle and the possibility of resolution with supply chain issues should affect broad inflation lower. Core PCE inflation is likely to moderate in the coming months, but it will still be above the Fed's 2% inflation target.

The Fed can be more moderate with upcoming rate hikes because of forward-looking inflation.

The price of gas in the US has dropped below $4 a gallon for the first time since March. Prices are expected to rise again.

Musk has sold $7 billion of his shares in the company to raise cash if he is forced to buy the social networking site. The move by Musk is writing on the wall that the deal will go through.

The price of oil was mixed. The price of West Texas Intermediate crude increased by 1%. The international benchmark of crude was down by 2%.

The price of gold was $1805.30 per ounce. The 10-year Treasury yield went up.

The price of the digital currency was $23,663.09.