The Dow Jones Industrial Average rose more than 250 points Thursday as investors sought to take advantage of depressed valuations among some of the market’s most sought-after technology stocks.

Investors bought up shares of companies including Facebook, Google parent Alphabet, Nvidia and Amazon.com, among others, on the final trading day of the quarter ahead of the Good Friday holiday.

The rally helped cut the blue-chip index’s quarterly loss—its first in more than two years—to 2.5%.

The index rose as much as 466 points earlier in the session before paring gains in the final hour of trading. The damage from two months of uncertainty over how rising interest rates will affect stock prices and the ramifications of trade tariffs, along with doubts whether shares of technology companies can continue to lead major indexes higher, proved too severe to overcome.

The S&P 500 fell 1.2% for the quarter, the first time in 10 quarters that either the S&P 500 or Dow posted a loss for a three-month period. The Nasdaq Composite, meanwhile, rose 2.3%, its weakest gain since the last quarter of 2016.