Stocks rose to all-time highs on Thursday, led by tech shares, as the strong rally in 2019 continued in the first trading day of the new year.

The Dow Jones Industrial Average advanced 330.36 points, or 0.9% to 28,868.80 and notched its biggest one-day gain since Dec. 6. The S&P 500 closed 0.8% higher —marking its best performance since Dec. 12 — at 3,257.85. The Nasdaq Composite gained 1.3% to end at 9,092.19 and had is best day since Oct. 11. The major averages hit their session highs in the final minutes of trading.

Chip stocks led the way on Wall Street. Advanced Micro Devices was up by 7.1% while Taiwan Semiconductor and Micron Technology both gained at least 3%. KLA and Intel rose by 2.5% and 1.7%, respectively. Apple was among the best-performing Dow stocks, closing 2.3% higher and hitting $300 per share for the first time.

Semiconductor stocks are coming off a strong performance in 2019. The VanEck Vectors Semiconductor ETF (SMH) surged 62% in 2019, its best one-year performance since 2003. On Thursday, the ETF closed 2.3% higher.

"We're starting the year off on the sunny side," said Peter Cardillo, chief market economist at Spartan Capital Securities. "Besides the geopolitical tensions, the focus remains on the macro news which has been consistent and points to growth ahead."

Thursday's gains come after Wall Street booked a strong 2019 performance on Tuesday, with the S&P 500 rising 28.9% in the year. That was the broad index's biggest annual gain since 2013, when it surged 29.6%. The Dow, meanwhile, climbed 22.3% while the Nasdaq Composite skyrocketed more than 35%.