U.S. stocks flitted between small gains and losses Thursday, kept under pressure by declines among shares of materials and financial companies.

The Dow Jones Industrial Average rose 9 points, or less than 0.1%, to 34043. The S&P 500 fell less than 0.1% and the Nasdaq Composite lost 0.1%.

Investors’ risk appetite ebbed after Federal Reserve officials Wednesday gave the clearest signals yet of their plans to gradually pull back the monetary policies that helped propel markets to record highs. Their median projection showed they see lifting their benchmark rate to 0.6% by the end of 2023, sooner than previously forecast.

“The key message is that we will not stay here forever,” said Florent Pochon, head of cross-asset strategies at Natixis. “The Fed really wanted to take the opportunity of the current window and the strong momentum to send the signal that it is ready to normalize, but it will be a difficult exercise if they want to avoid another taper tantrum.”

Policy makers discussed the prospect of tapering the Fed’s bond-buying program, but the timing of such a move remains unclear, Chairman Jerome Powell said.

While stocks drifted in a relatively narrow range, gold prices fell over 4% Thursday, the most in over 10 months. The precious metal, which doesn’t offer any income to investors, generally becomes less attractive to investors compared to yield-bearing investments when rates look set to rise.

The WSJ Dollar Index, which tracks the U.S. currency against a basket of others, advanced 0.3%. That added to its 0.8% gain Wednesday, which was its biggest climb in more than a year.

“It was certainly a hawkish surprise, but given what we have seen with the growth picture and higher inflation, it would have been a surprise if there hadn’t been a shift,” said Seema Shah, chief strategist at Principal Global Advisors. “There have been some concerns building that the Fed was going to fall behind the curve, and I think this suggests that they won’t.”

Among individual stocks, Curevac slumped 48% after the German company said its experimental Covid-19 vaccine fared poorly in a large clinical trial, dimming the shot’s prospects for wider use.

Ford Motor rose 1% after the automaker said it expects earnings for the second quarter to exceed its expectations.

Materials shares fell alongside gold prices, with mining company Barrick Gold dropping 3.2% and Newmont dropping 3%.

Overseas, the pan-continental Stoxx Europe 600 slipped 0.1% after closing Wednesday at a record.

Japan’s Nikkei 225 closed down 0.9%, and South Korea’s Kospi Composite index edged 0.4% lower. The Shanghai Composite ticked up 0.2% and Hong Kong’s Hang Seng rose 0.4% each.

Federal Reserve Chairman Jerome Powell described the outlook for inflation in the U.S. economy and said there are signs that prices that have moved up quickly should cease rising and retreat. Credit: Al Drago/Associated Press The Wall Street Journal Interactive Edition

A strong U.S. economy means that inflation will be quicker as there is a clear demand for labor, said Kerry Craig, global market strategist at J.P. Morgan Asset Management. “The markets are coming round to reality on that,” he said.

Mr. Craig expects the American central bank to start talking about plans to taper its current bond-buying program in September, and start scaling back early next year, followed by one increase in interest rates by the end of 2023.

South Korean and Japanese stock indexes fell Thursday.

South Korean and Japanese stock indexes fell Thursday.

Photo: Lee Jin-man/Associated Press

Write to Will Horner at William.Horner@wsj.com and Chong Koh Ping at chong.kohping@wsj.com