The S&P 500 declined 0.58% to end the session at 7,673.52 points.
The Nasdaq dipped 0.32% to 26,421.41 points, while the Dow Jones Industrial Average declined 1.18% to 52,786.07 points.
Volume on U.S. exchanges was heavy, with 15.7 billion shares traded, compared to an average of 14.9 billion shares over the previous 20 sessions.
The S&P 500 has gained about 12% in 2026, and it remains down about 1% from its record-high close on August 13.
The benchmark stock index is now valued at 19 times expected earnings, down from 21 in early June, according to LSEG data. That lower valuation reflects increased earnings expectations following a strong second-quarter reporting season.
Despite that increased earnings optimism, the U.S.-Israeli war with Iran has remained an overhang on equities.
Oil prices touched a six-week high on Tuesday after Iran-backed Houthis in Yemen attacked Saudi energy facilities, setting oil installations ablaze and threatening a major expansion of the six-month-old Middle East war.
Shipping traffic through the Strait of Hormuz slowed, with Iran threatening on Monday to retaliate for any new U.S. attacks.
"The conflict between the United States and Iran is beginning to look less like a temporary disruption and more like a longer-term backdrop for markets," said Jeff DerGurahian, chief investment officer at loanDepot.
The S&P 500 energy index .SPNY rose 1%, with Marathon Petroleum MPC.N up 2.4% and Occidental Petroleum OXY.N adding 1%.
Elevated yields on risk-free U.S. Treasuries have in recent weeks made it less attractive for investors to take on the added risk of buying stocks.
Crypto stocks fell as bitcoin retreated from $80,000. Coinbase COIN.O lost 3.1% and Strategy MSTR.O dipped 4.4%.
Declining stocks outnumbered rising ones within the S&P 500 .AD.SPX by a 2.4-to-1 ratio.
The S&P 500 posted five new highs and 10 new lows; the Nasdaq recorded 55 new highs and 136 new lows.