Health-care companies rose as traders continued to rotate out of high-risk artificial-intelligence stocks into lagging sectors.

Stocks in the healthcare sector pull back amid quarter-end portfolio rebalancing and as investors rotate back to tech names.

Health-care companies rose as traders rotated out of artificial-intelligence bets into sectors that lagged in the second quarter.