The S&P 500 climbed 0.70% to end the session at 7,489.72 points. Even as the S&P 500 rose, declining stocks outnumbered rising ones .AD.SPX by a 1.3-to-one ratio.
The Nasdaq gained 1% to 25,373.85 points, while the Dow Jones Industrial Average rose 0.53% to 52,485.03 points.
Volume on U.S. exchanges was heavy, with 20.6 billion shares traded, compared with an average of 17.1 billion shares over the previous 20 sessions.
For the week, the S&P 500 rose 1.05% and the Nasdaq added 1.59%.
The S&P 500 ended July about flat from June, while the Nasdaq fell 3.2%. Both indexes are up about 9% in 2026.
Analysts on average expect S&P 500 aggregate second-quarter earnings to soar 48% from a year ago, with AI-related stocks accounting for much of that growth, according to LSEG I/B/E/S.
Strong earnings forecasts and a recent decline in share prices have left the S&P 500 trading at about 20 times expected earnings, just above its 10-year average of 19 times, according to LSEG data.
The S&P 500 equal-weighted index .EWGSPC logged its fourth straight month of gains, thanks to its limited exposure to heavyweight AI-related stocks that have underperformed for much of that time.
Three Federal Reserve officials who dissented at the Fed's policy meeting this week in favor of an interest rate hike called on Friday for immediate action to bring inflation down to the U.S. central bank's 2% target.
The 2-year US2YT=RR U.S. Treasury yield, which typically moves in step with interest rate expectations for the Fed, rose 5.4 basis points to 4.28% but is down slightly for the week.
Markets are pricing in a 65% chance of a rate hike at the Fed's September meeting, according to CME FedWatch, down from 82% a week ago but up slightly from 63% on Thursday.
Domain registrar GoDaddy GDDY.N dropped almost 17% after narrowing its annual revenue forecast.
The S&P 500 posted four new highs and four new lows; the Nasdaq recorded 52 new highs and 131 new lows.