Investors digested data showing that inflation is continuing to ease and that the Federal Reserve's rate hikes are serving their purpose as US stocks ended Friday's session with gains.

Both the S&P 500 and the tech-heavy Nasdaq 100 finished the week lower. The indexes have lost three weeks in a row, their longest losing streak since late September, as investors grappled with a hawkish Fed and data indicating a resilient economy that can withstand more rate hikes.

Treasury yields fell at the end of a holiday-shortened session. The benchmark 10-year yield rose the most this week since early April, finishing around 3.75% on Friday. The dollar fell for the week. The yen has reached its highest level since June as a result of the Bank of Japan's unexpected increase in its yield trading band, which is expected to encourage Japanese investors to bring money home.

Data today showed that the Fed's closely watched measure of inflation was cooling and consumer spending was stagnant. Consumers' year-ahead inflation expectations fell this month to their lowest level since June 2021, according to a survey conducted by the University of Michigan. Both sets of data helped to calm the market.

While central bank officials have repeatedly stated that they will continue to raise interest rates this year, markets have often ignored these warnings. However, economic data has kept investors on edge. They've been especially attentive to job-related information, as the Fed is keeping an eye on labor-market softening.

In recent months, investors have welcomed a slowing of inflation. However, data indicating a strong economy has frequently resulted in choppy sessions for markets, with some traders reassured that a US recession is still a possibility, while others fear that the Fed will remain aggressive.