NEW YORK (AP) - Stocks finished a volatile day slightly higher on Monday after reversing a steep slide caused by uncertainty over inflation-fighting measures from the Federal Reserve and the possibility of conflict between Russia and Ukraine.

A late-day buying spree pushed the benchmark S&P 500 index to a 0.3% gain after pulling it out of so-called correction territory - a drop of 10% or more from its recent high.

“We're in this wait-and-see mode, which is almost the most uncomfortable place to be, so I think the market is really grappling with that,” said Lindsey Bell, chief markets and money strategist at Ally Invest.

Monday's turnaround followed a three-week decline for the S&P 500, concluding with its worst weekly stretch since the start of the pandemic.

The S&P 500 had been down as much as 4% Monday. The index has recovered from an intraday loss that big only three times in the past. The tech-heavy Nasdaq index rose 0.6% after recovering from a nearly 5% descent.

Early in the day, benchmark stock indexes flirted with near 4-month lows as investors anticipated guidance from the Fed later this week about its plans to raise interest rates to tame inflation, which is at its highest level in nearly four decades.

The Fed's short-term rate has been pegged near zero since the pandemic hit the global economy in 2020 and that has fueled borrowing and spending by consumers and businesses.

But rising prices at supermarkets, car lots and gas stations are raising concerns that consumers will pare back spending to limit the pressure on their budgets. Companies have warned that supply-chain problems and higher raw materials costs could crimp their profits.

The Fed has kept downward pressure on longer-term interest rates by buying trillions of dollars worth of government and corporate bonds, but those emergency purchases are scheduled to end in March. Nudging rates higher is intended to help slow economic growth and the rate of inflation.

“There's a short-term panic and part of that is the high level of uncertainty around what the Fed is going to do,” said Sylvia Jablonski, chief investment officer at Defiance ETFs.

Investors are also keeping an eye on developments in Ukraine. Tensions soared Monday between Russia and the West over concerns that Moscow is planning to invade Ukraine, with NATO outlining potential troop and ship deployments.

The S&P 500 rose 12.19 points to 4,410.13. It's now 8.1% below the all-time high it set on Jan. 3.

The Dow rose 99.13 points to 34,364.50. The Nasdaq gained 86.21 points to 13,855.13.

Small company stocks also bounced back. The Russell 2000 rose 45.59 points, or 2.3%, to 2,033.51. The index had been down 2.8%.

Bond yields mostly rose after falling earlier in the day. The yield on the 10-year Treasury rose to 1.77% from 1.74% late Friday.

Higher interest rates tend to make shares in high-flying tech companies and other expensive growth stocks relatively less attractive. Tech stocks accounted for much of the S&P 500's early slide. The sector ended up higher overall, though some big names didn't recover entirely. Apple fell 0.5%.

The wave of selling also extended to cryptocurrencies. Bitcoin fell as low as $33,000 overnight but rallied back above $36,000 by late afternoon. Still, the digital currency is far below the high of more than $68,000 it hit in November.

Retailers notched some of the biggest gains in the comeback: Gap jumped nearly 8%.

The market is waiting to hear from chair Jerome Powell Wednesday after Fed policymakers conclude a two-day meeting and offer their latest thinking on the economy and interest rates. Some economists have expressed concern that the Fed is already moving too late to combat high inflation.

Other economists say they worry that the Fed may act too aggressively. They argue that numerous rate hikes would risk causing a recession and wouldn't slow inflation in any case. In this view, high prices mostly reflect snarled supply chains that the Fed's rate hikes are powerless to cure.

When the Fed boosts its short-term rate, it tends to make borrowing more expensive for consumers and businesses, slowing the economy with the intent of reducing inflation. That could reduce company earnings, which tend to dictate stock prices over the long term.

The Fed's benchmark short-term interest rate is currently in a range of 0% to 0.25%. Investors now see a nearly 65% chance that the Fed will raise the rate four times by the end of the year, up from a 35% chance a month ago, according to CME Group's Fed Watch tool.

Wall Street anticipates the first increase in interest rates in March. In a note to clients over the weekend, Goldman Sachs forecast four rate hikes this year but said the Fed could be forced to raise rates five times or more if supply chain problems and wage growth keep inflation at elevated levels.

Europe's STOXX 600 index closed down 3.6% on concerns about Fed tightening and worries about the situation around Ukraine. The Russian ruble has also fallen after U.S. President Joe Biden indicated that in the event of a Russian invasion the U.S. could block Russian banks from access to dollars or impose other sanctions.

Investors are monitoring the latest round of corporate earnings, in part, to gauge how companies are dealing with higher prices and what they plan to do as inflation continues pressuring operations.

On Tuesday, American Express, Johnson & Johnson, and Microsoft report results. Boeing and Tesla report their results on Wednesday. McDonald's, Southwest Airlines and Apple report results on Thursday.

Associated Press reporters Christopher Rugaber in Washington, Stan Choe in New York and David McHugh in Frankfurt contributed. Veiga reported from Los Angeles.