A stock market rally stalled after two Federal Reserve officials signaled that interest rates could rise above 5%, casting doubt on traders expecting a peak below that level.

The S&P 500 failed to hold above the key 3,900 level, wiping out a 1.5% gain earlier in the session. The Dow Jones Industrial Average underperformed, while the Nasdaq 100 remained higher due to gains in big tech, including a 6% surge in Tesla. The dollar recovered some of its losses.

Fed Bank of San Francisco President Mary Daly stated that she expects the central bank to raise interest rates to above 5%. Raphael Bostic, her Atlanta counterpart, noted that policymakers should hike above 5% by early in the second quarter and then remain on hold for "a long time."

Investors were also looking forward to Thursday's US CPI report, which will be released nearly a week after the latest jobs data showed that wage growth has slowed. The figures will be among the last such readings seen by policymakers before their meeting on January 31-February 1.