U.S. stocks erased losses to trade higher Thursday, with investors finding refuge in large-cap American technology shares, as a decline in oil prices eased concern Russia’s invasion of Ukraine would result in an immediate worsening of the inflation picture.

The S&P 500 added 1.2%, while the Dow Jones Industrial Average was little changed, teetering on the edge of a correction, as the conflict with Russia cast a pall over global markets. The Stoxx Europe 600 fell 3.3% and Russian shares slumped the most on record.

Russian President Vladimir Putin said Russia doesn’t plan to “occupy” its neighbor as military forces entered, accompanied by missile and artillery fire, but that action was necessary after the U.S. and its allies crossed Russia’s “red line” by expanding the NATO alliance. U.S. President Joe Biden has responded with additional sanctions and said the U.S. would release more strategic oil as conditions warrant.
“Russia invading Ukraine has added to an already tense year, with investors selling first and asking questions later,” Ryan Detrick, LPL Financial chief market strategist, said. “But it is important to know that past major geopolitical events were usually short-term market issues, especially if the economy was on solid footing.”