The indexes were also set to end higher on a week that also saw a sharp rally in US Treasuries amid the fears that the recovery in the US economy was losing steam with the Delta variant of the coronavirus spreading.
S&P financials led sector gains, followed by materials.
Investors are eager to hear from US companies next week when the second-quarter earnings season begins. Big banks will be among the first to report.
Analysts expect earnings growth of 65.8% for companies in the S&P 500 index in the quarter, up from a previous forecast of 54% growth at the start of the period, according to Refinitiv IBES data.
“Earnings are likely to be good because earnings were so weak from a year ago at this time,” said Rick Meckler, partner at Cherry Lane Investments in New Vernon, New Jersey.
The Dow Jones Industrial Average rose 454.61 points, or 1.32%, to 34,876.54, the S&P 500 gained 47.99 points, or 1.11%, to 4,368.81 and the Nasdaq Composite added 136.00 points, or 0.93%, to 14,695.79.
Among individual stocks, Levi Strauss & Co added 1.3% as it forecast a strong full-year profit after beating quarterly earnings estimates on improving demand across its markets for jeans, tops, and jackets.
US-listed shares of Chinese ride-hailing company Didi Global Inc rose 8.8% after four sessions of losses, as it was recently hit by an investigation from China’s internet watchdog.
Advancing issues outnumbered declining ones on the NYSE by a 4.08-to-1 ratio; on Nasdaq, a 3.09-to-1 ratio favored advancers.
The S&P 500 posted 35 new 52-week highs and no new lows; the Nasdaq Composite recorded 53 new highs and 30 new lows.