The S&P 500 and Nasdaq Composite had their highest closings on record Tuesday, marking a resurgence for the stock market after a rout last year hampered its climb.

The broad index rose 25.71 points, or 0.9%, to 2933.68, breaking past its previous closing high on Sept. 20 to finish at the highest closing level on record. The Nasdaq, meanwhile, jumped 105.56 points, or 1.3%, to 8120.82, topping its Aug. 29 record closing level.

Stocks...