Stocks rose late in the day Friday as investors welcomed signs of progress in resolving the trade dispute between the U.S. and China. The Wall Street Journal reported that the countries hope to have a resolution by November.
Industrial, health care and basic materials companies made some of the biggest gains. The report came a day after China said it will send an envoy to Washington for the first talks between the countries since early June.
Marina Severinovsky, an investment strategist at Schroders, said stocks could jump if the U.S. and China make real progress toward a trade agreement. But stocks in emerging markets might make even bigger gains.
"The rally that could come, if there is a better outcome, would be in emerging markets," she said. "China has suffered pretty greatly ... the U.S. has held up pretty well."
The late gains came in spite of weak results for several chipmakers. Electric car maker Tesla took its biggest drop in two years on reports of a wider government investigation into the company and concerns about CEO Elon Musk's health.
The S&P 500 index rose 9.44 points, or 0.3 percent, at 2,850.13. The Dow Jones Industrial Average added 110.59 points, or 0.4 percent, to 25,669.32. The Nasdaq composite edged up 9.81 points, or 0.1 percent, to 7,816.33. The Russell 2000 index of smaller-company stocks gained 7.19 points, or 0.4 percent, to 1,692.95.
The Wall Street Journal cited officials in both the U.S. and China as it said negotiators want to end the trade war before U.S. President Donald Trump and Chinese President Xi Jinping meet at multilateral events in November.
Industrial companies made some of the biggest gains after agricultural equipment maker Deere posted stronger than expected sales. Its stock rose 2.4 percent to $140.59.
Construction equipment maker Caterpillar rose 2.3 percent to $139.34 and engine maker Paccar added 2.3 percent to $67.16.
Chipmakers fell after two companies gave weaker forecasts for the third quarter. Nvidia said it no longer expects much revenue from products used in mining digital currencies, and its stock fell 4.9 percent to $244.82. Applied Materials slumped 7.7 percent to $43.77.
While big names like Netflix, Facebook and Amazon slipped, Apple led technology companies slightly higher overall. Apple stock rose 2 percent to $217.58.
Nordstrom jumped 13.2 percent to $59.18 after raising its annual profit and sales forecasts and posting better earnings and sales than analysts expected. It's been a mostly difficult week for department stores as Macy's and J.C. Penney both plunged after issuing their quarterly reports.
The S&P 500 finished this week with a solid gain of 0.6 percent, but it took a difficult path to get there. Stocks fell early this week due to worries about Turkey's currency crisis, and later investors fretted about China's economic growth.
The recovery started Thursday as investors hoped the upcoming talks between the U.S. and China will help end the impasse that has resulted in higher tariffs from both countries.
The Hang Seng index in Hong Kong has fallen 13 percent since early June as the dispute has dragged on, and other emerging market indexes have also taken a hit. The S&P 500 has risen over that time.
Tesla was hit with a series of reports that concerned shareholders. The Wall Street Journal reported that the Securities and Exchange Commission started investigating the electric car maker last year to determine if it made false statements about production of its Model 3 sedan.
The SEC is also reportedly looking into CEO Elon Musk's comment on Twitter about possibly taking the company private.
Tesla stock rose from about $345 a share to about $380 following Musk's tweet last week, which said Tesla could go private for $420 a share. On Friday it dropped 8.9 percent to $305.50.
Musk also gave an emotional interview to the New York Times, published Friday, about the stress he's experienced as the company tries to ramp up production. He said this year has been "excruciating" and described working up 120 hours a week, raising concerns about his health.
Bond prices rose. The yield on the 10-year Treasury note fell to 2.86 percent from 2.87 percent.
U.S. crude picked up 0.7 percent to $65.91 a barrel in New York. Brent crude, the standard for international oil prices, added 0.6 percent to $71.83 per barrel in London.
Wholesale gasoline dipped 0.3 percent to $1.98 a gallon. Heating oil inched up 0.1 percent to $2.10 a gallon. Natural gas rose 1.3 percent to $2.95 per 1,000 cubic feet.
Gold was little changed at $1,184.20 an ounce. Silver fell 0.6 percent to $14.63 an ounce. Copper added 0.5 percent to $2.63 a pound.
The dollar dipped to 110.60 yen from 110.88 yen. The euro rose to $1.1443 from $1.1365.
The German DAX lost 0.2 percent and France's CAC 40 fell 0.1 percent. The FTSE 100 in Britain was little changed.
Japan's Nikkei 225 index added 0.4 percent and Hong Kong's Hang Seng gained 0.4 percent. In South Korea, the Kospi gained 0.3 percent.