Stocks climbed Monday and gave one last nudge to ensure the S&P 500 emerges from yet another tumultuous quarter with a modest gain.
As has been the case throughout the quarter, movements in President Trump’s trade war with China helped drive the market Monday. Investors found encouragement after China said its top trade negotiator will lead talks with the United States that are expected next week. The Trump administration also calmed some worries that it may limit US investment in Chinese companies.
The developments helped push technology stocks higher, in particular. Those companies often move along with worries about trade because of how reliant they are on China as both a customer and a supplier.
The S&P 500 climbed 14.95 points, or 0.5 percent, to 2,976.74.
The Dow Jones average rose 96.58, or 0.4 percent, to 26,916.83, and the Nasdaq Composite added 59.71, or 0.8 percent, to 7,999.34.
The moves left the S&P 500 with a 1.2 percent gain for the quarter. While that was its smallest quarterly gain this year, the index had been on track for a much worse performance just a month ago.
Trump shocked markets in August when he said he’s raise tariffs on Chinese goods, and the announcement sent stocks and bond yields reeling. The S&P 500 dropped more than 6 percent in the weeks following July 26, when it set its last record. But stocks began climbing again in September as both sides made conciliatory moves to ease tensions.
Yields, meanwhile, remained lower for the quarter after the Federal Reserve cut short-term rates twice. They were the first rate cuts for the Fed since the financial crisis was swamping the economy in 2008. Across the Atlantic, the European Central Bank was likewise working to keep rates low in hopes of shoring up a slowing global economy.
The yield on the 10-year Treasury dipped to 1.65 percent from 1.67 percent late Friday. At the end of the last quarter, it was at 2 percent.
Like the S&P 500, the Dow also ended the quarter with a gain of 1.2 percent. The technology-heavy Nasdaq was a touch lower, with a loss of 0.1 percent.
Small companies took more damage, as they typically do when investors are worried about the threat of a recession. The Russell 2000 lost 2.8 percent during the quarter.
Don’t expect the tumult to end with the close of the quarter.
Aside from the US-China talks, the next three months have plenty of events on the schedule to keep markets on edge. Beyond the United Kingdom’s pending exit from the European Union, investors are also waiting to see whether Germany will enter a recession and how the new incoming head of the European Central Bank performs.
Closer to home, the impeachment inquiry into Trump could create even more uncertainty. That puts more pressure on what’s been the bulwark of the US economy recently, particularly when businesses have become reluctant to spend due to the trade war.
‘‘The consumer’s been enough to keep the economy moving, but things like consumer confidence seem to be plateauing,’’ said Emily Roland, co-chief investment strategist at John Hancock Investment Management.
In the next few weeks, companies are scheduled to tell investors how much profit they made during the third quarter. Expectations are generally low again, with analysts forecasting a drop of nearly 4 percent from a year ago. The results, plus what CEOs say about their spending and revenue forecasts, should give a better picture of the economy’s potential direction.
‘‘We need that earnings engine to kick in to drive markets higher,’’ Roland said.
Last year, the S&P 500 slumped 14 percent in the fourth quarter for its worst performance in seven years when fear spiked that the Federal Reserve’s plans to keep raising interest rates and a slowing global economy would knock the United States into a recession.
This time around, the Federal Reserve has shifted gears, and many investors expect the central bank to cut rates at least one more time this year. That could help support markets, even with all the potential flashpoints set on the calendar.
Benchmark US crude fell $1.84 to settle at $54.07 per barrel Monday. Brent crude, the international standard, fell $1.13 to $60.78.
Stock markets around the world were mixed during the quarter, as European growth remained stubbornly weak and Hong Kong saw increasingly violent political protests. In Europe, France’s CAC 40 finished with a 2.5 percent gain for the quarter. Germany’s DAX rose 0.2 percent, and the FTSE 100 lost 0.2 percent.
In Asia, Japan’s Nikkei 225 index rose 2.3 percent for the quarter, while South Korea’s Kospi fell 3.2 percent and the Hang Seng in Hong Kong lost 8.6 percent.