By Caitlin Ostroff and Gunjan Banerji

The S&P 500 edged higher in the final trading day of the week, closing out a fourth consecutive month of gains.

The broad-based U.S. stock benchmark added 0.1%. The tech-heavy Nasdaq Composite also gained 0.1%. The Dow Jones Industrial Average rose 65 points, or 0.2%.

The S&P 500 and Dow clinched modest gains for the month of May, while the Nasdaq declined 1.5%, snapping a six-month streak of wins.

The month has been marked by big swings in everything from stocks to bitcoin. Worries about inflation injected a jolt of volatility to markets earlier in May, though major U.S. indexes have regained their footing since as investors rapidly stepped back into markets.

The Federal Reserve's preferred measure of inflation -- the price index for personal-consumption expenditure, excluding food and energy -- rose 3.1% from a year earlier. A surge in demand after Covid-19 restrictions were lifted, coupled with supply chain strains, likely led to a rise in prices last month.

Investors and central bankers have closely monitored inflation data to see if these pressures are likely to be temporary or long-lasting. Such data will guide whether policy makers relax measures that have helped markets recover from pandemic lows.

"We don't think the Fed's going to raise rates aggressively. We think they'll remain behind the curve because they want to help the economy recover," said Paul Flood, investment manager at Newton Investment Management. "Everybody is expecting inflation in the short term."

Fresh data also showed that Americans extended a spending binge in April, as they continued catching up on activities they held off on during the pandemic, propelling the economy. Consumer spending rose 0.5% from March.

President Biden is expected to unveil a $6 trillion budget Friday that could help support stocks most linked to the economic recovery, said Carsten Brzeski, ING Groep's global head of macro research.

Overseas, the pan-continental Stoxx Europe 600 stock index, which contains a swath of companies that benefit from global economic growth, rose 0.7% to a fresh record high.

Shares of HP tumbled 8.9%, despite the computermaker raising its profit projections for the year following better-than-expected quarterly results.

A dizzying run for meme stocks continued this week. AMC Entertainment jumped more than 25% early Friday, then ended the day about 1.5% lower. GameStop fell 12.6% and Express dropped 10.8%.

Ulta Beauty shares rose 5.2% after the beauty retailer swung to a profit during its latest quarter, as sales picked up with the economy rebounding..

Cryptocurrency bitcoin, which has seen a volatile month of trading, fell about 6% from where it traded Thursday afternoon to $35,988.

In bond markets, the yield on the 10-year Treasury note ticked down to 1.600% from 1.609% Thursday. Yields and prices move inversely.

The Turkish lira hit a record low Friday, with one dollar buying 8.6096 lira.

In Asia, major benchmarks largely closed higher. Japan's Nikkei 225 advanced 2.1%, led by industrial companies. Mitsubishi Heavy Industries gained 5.5%.

China's Shanghai Composite Index declined 0.2%. South Korea's Kospi added 0.7%.

Write to Caitlin Ostroff at caitlin.ostroff@wsj.com and Gunjan Banerji at Gunjan.Banerji@wsj.com

(END) Dow Jones Newswires

05-28-21 1623ET