US stocks roared on Wednesday after a fresh reading on inflation showed consumer prices increased less than expected in May. The latest snapshot of inflation comes hours before a highly anticipated Federal Reserve meeting in the afternoon will provide the latest signal on the path of interest rates.

The S&P 500 (^GSPC) built on a 27th record close of the year, rising more than 1.2%. The tech-heavy Nasdaq Composite (^IXIC) rose nearly 1.8%, also adding to a record close from the prior day. The Dow Jones Industrial Average (^DJI) also popped about 0.5%.

The Consumer Price Index (CPI) remained flat over the previous month and rose 3.3% over the prior year in May — a deceleration from April's 0.3% month-over-month increase and 3.4% annual gain in prices. Both measures beat economist expectations. On a "core" basis, which strips out the more volatile costs of food and gas, prices in May climbed 0.2% over the prior month and 3.4% over last year — cooler than April's data. Both measures also came in better than economist estimates.

This shifted market expectations for Fed rate cuts this year. Following the data's release, markets were pricing in a roughly 69% chance the Federal Reserve begins to cut rates by its September meeting, according to data from the CME FedWatch Tool. That's up from about a 53% chance the day prior.