The S&P 500 and Nasdaq Composite rallied on Tuesday to notch record closing highs as Wall Street cheered stronger-than-expected quarterly profits from some of the largest publicly traded U.S. companies.

The broad index closed 0.9% higher at 2,933.68, topping its previous record close of 2,930.75. The S&P 500 also ended the day just below its intraday record of 2,940.91. The Nasdaq closed up 1.3% at 8,120.82. The Dow Jones Industrial Average, meanwhile, gained 145.34 points to close at 26,656.39 and was 1.1% from an all-time high.

Tuesday’s move toward an all-time closing high comes less than six months after a sharp decline in late December, which led the S&P 500 to its worst annual performance since 2008. But stocks quickly turned around as the Federal Reserve reversed course on monetary policy while the tone around U.S.-China trade talks improved.