The S&P 500 ended the day down slightly on Friday but less than 1% below its all-time high as a drop in Apple stock countered cooling US-China trade tensions.
Tariff-vulnerable industrials helped keep the blue-chip Dow in positive territory, which has now gained in eight straight sessions, its longest winning streak since May 2018.
All three major US stock indexes posted their third straight weekly gains, capping a week that saw signs of a potential thaw in the trade war between the world's two largest economies, which has gripped markets for months.
Apple Inc was the biggest drag on the major stock averages, falling 1.9% after Goldman Sachs cut its price target for the iPhone maker's shares.
Beijing announced it would exempt some US agricultural products from additional tariffs after President Donald Trump suggested he could be open to an interim deal, the latest conciliatory gestures by both sides of the trade war ahead of next month's negotiations in Washington.
"Apple is holding back the averages," said Peter Cardillo, chief market economist at Spartan Capital Securities in New York. "Another factor is we have a huge rally in (Treasury) yields, the 10-year is up substantially. Those two factors are holding back the market and dampening the enthusiasm that some kind of cosmetic trade deal is on its way."
However, rising Treasury yields did boost interest-rate sensitive financials, which gained 0.8%.
On the economic front, US retail sales increased in August at twice the rate analysts expected, according to the Commerce Department, suggesting that strong consumer spending will continue to support the longest-ever US economic expansion.
"The consumer is pretty cheerful," Cardillo added. "Going into the holiday season the consumer is likely to continue to spend, and that bodes well as far as the consumer-led economy is concerned."
Ebbing trade jitters and upbeat retail sales data helped US Treasury yields reach multi-week highs, providing an attractive alternative to risk-averse investors.
Market participants now look to the US Federal Reserve, which is widely expected to cut interest rates by 25 basis points at the conclusion of its monetary policy meeting next week.
The Dow Jones Industrial Average rose 37.07 points, or 0.14%, to 27,219.52, the S&P 500 lost 2.18 points, or 0.07%, to 3,007.39 and the Nasdaq Composite dropped 17.75 points, or 0.22%, to 8,176.71.
Of the 11 major sectors in the S&P 500, five closed in the red, with real estate suffering the largest percentage loss, 1.3%.
Materials was the biggest percentage winner, gaining 1.1%.
Chipmaker Broadcom Inc slipped 3.4% after the company missed quarterly revenue estimates late Thursday and said that while semiconductor demand has likely hit bottom, the timing of a recovery remains uncertain.
Progressive Corp fell 5.6% after the insurer reported a 36% year-on-year drop in August net income.
Lumber Liquidators Holdings Inc plunged 13.2% after founder Thomas Sullivan told Bloomberg he was holding off on plans to take the company private.
Tyson Foods Inc, the largest US meat processor, advanced 2.0% on China's tariff exemption announcement.
Declining issues outnumbered advancing ones on the NYSE by a 1.11-to-1 ratio; on Nasdaq, a 1.21-to-1 ratio favoured advancers.
The S&P 500 posted 20 new 52-week highs and one new low; the Nasdaq Composite recorded 82 new highs and 20 new lows.
Volume on US exchanges was 6.93 billion shares, compared with the 6.75 billion-share average over the last 20 trading days.