Stocks shook off an early wobble to eke out small gains Tuesday, nudging the S&P 500 index to an all-time high for the second straight day.
Communications services, technology and consumer goods companies helped push the market higher. Those gains outweighed losses in energy and financial stocks and elsewhere.
Trading was subdued ahead of the Independence Day holiday in the U.S. Thursday. Markets will close early on Wednesday.
Investors drove a strong comeback in stocks last month and have continued to do so this week on expectations that the Federal Reserve will cut interest rates amid signs of a slowing global economy and uncertainty over multiple U.S. trade disputes.
Traders are waiting to see what will come from the latest truce in the U.S.-China trade war. They're also looking ahead to a key government jobs report due out Friday, among other potential market-moving developments in the next few weeks.
"With everyone trying to figure out what the next step is going to be in terms of what the Fed is going to do and how strong the economy is, we're kind of in a void here today," said Willie Delwiche, investment strategist at Baird.
After barely budging for much of the day, the S&P 500 rose 8.68 points, or 0.3%, to 2,973.01. That's the benchmark index's seventh record high this year.
The Dow Jones Industrial Average gained 69.25 points, or 0.3%, to 26,786.68. The Nasdaq composite added 17.93 points, or 0.2%, to 8,109.09. Small-company stocks fell, sending the Russell 2000 index down 9.13 points, or 0.6%, to 1,560.54.
Major stock indexes in Europe finished higher.
Wall Street's gains in the first half of the year were marked by months of volatile trading as investors rode the ups and downs of the trade war. That volatility is unlikely to fade as Washington and Beijing move forward with another round of negotiations.