Stocks closed higher Monday as major indexes bounced back from earlier losses as renewed confidence in the strength of the U.S. economy offset lingering worries over the U.S.-China trade dispute.

The Dow Jones Industrial Average DJIA, -1.92% rose 34.31 points, or 0.1%, to end at 24,423.26, while the S&P 500 SPX, -2.37% gained 4.64 points, or 0.2%, to 2,637.72. The Nasdaq Composite Index COMP, -3.01% advanced 51.27 points, or 0.7%, to close at 7,020.52.

At session lows, the Dow had lost more than 500 points, while the S&P had shed 50 points and the Nasdaq had been down 81 points. The S&P 500 closed 1.9% above its intraday low, its biggest such bounce since Feb. 6; the Dow closed 2.1% above its session low for its biggest intraday, upside reversal since April 4, according to Dow Jones Market Data.

What drove the market?

Concerns over global growth as well as trade woes overshadowed the market in early going after latest data showing a sharp slowdown in Chinese export growth reinforced fears that the best of the current bull market is behind us.

However, the belief that the U.S. economy, at least, could continue to grow at a healthy pace into next year and beyond neutralized some of the worst jitters, in part due to comments from influential banks such as J.P. Morgan and Goldman Sachs that fears about U.S. economic growth are overblown.

Their views are supported by several indicators, including the ISM survey which shows resilient demand. The Labor Department also said U.S. job openings rose to 7.08 million in October, from 6.96 million a month earlier.

But trade worries have also been getting in the way of traditional end-of-year gains. China’s Vice Foreign Minister Le Yucheng summoned the U.S. ambassador on Sunday to insist the U.S. withdraw its arrest warrant on Huawei’s chief financial officer Meng Wanzhou, who was detained on Dec. 1 in Canada.

Read:Huawei arrest creates concerns in Silicon Valley as well as abroad

Some are worried that the Huawei executive’s arrest, news of which triggered sharp losses for Wall Street and global markets last week, will make it tough for China to follow through on trade concessions to the U.S. Investors are already dubious over how much progress was made between the two countries at the recent G-20 meeting.

Concerns over an escalating trade conflict were also compounded by comments from U.S. Trade Representative Robert Lighthizer, who told CBS’ Face the Nation on Sunday that he considers the 90-day moratorium from new tariffs granted to the Chinese a “hard deadline,” and that the administration is not considering delaying an escalation of the trade conflict if the two sides can’t agree to an armistice by March 1.

Opinion:The stock market is overreacting because fears about the economy are overblown

Investors are increasingly focusing on the Dec. 18-19 Federal Reserve meeting, where the central bank is widely expected to raise interest rates. Comments from Fed Chairman Jerome Powell will be in the spotlight, and if he strikes a more conciliatory tone, hinting at a slowing of future hikes, it could spark the highly anticipated Santa rally.

Meanwhile, British Prime Minister Theresa May confirmed a decision to postpone a vote on her plan for the U.K. to exit from the European Union, potentially adding another complication to the fraught Brexit process.

What were analysts saying?

“Higher volatility and wider intraday and intraweek ranges are likely par for the course these days and momentum can shift without an easily-defined reason. A few key large cap tech stocks caught a bid today and that helped rally the Nasdaq off the day’s lows,” said Liz Ann Sonders, chief investment strategist, at Charles Schwab & Co.

“The majority of the news last week [was] net positive,” Tom Essaye, president of the Sevens Report, said in a note to clients.

“There won’t be 25% tariffs on Jan. 1, and momentum toward a deal appears to be building, as the jobs report was solid but not too hot, while ISM Manufacturing PMIs were strong, and the Fed is shifting more and more dovish,” he wrote.

What stocks were in focus?

Shares of Tesla Inc. TSLA, -10.34% rose 2%. Chief Executive Officer Elon Musk appeared on “60 Minutes,” defending himself and the company from what he referred to as “relentless criticism.” Musk said he set and made a production target of 5,000 Model 3s a week and made the company profitable.

Apple Inc. AAPL, -4.19% gained 0.7% despite negative headlines that sent shares lower in early trading. A key supplier, Japan Display Inc. JNNDF, -1.28% , said it was cutting production for crystal display panels for the iPhone XR.

The company is also the focus of a dispute with Qualcomm Inc. QCOM, -2.85% , and the chip maker announced that a Chinese court ordered Apple to stop selling older iPhone models in the country due to patent infringement. Qualcomm stock rose 2.2%.

Shares of Facebook Inc. FB, -2.24% rose 3.2% after the social media company on Friday said it has raised its buyback program by another $9 billion.

Axovant Sciences Ltd. US:AXON plunged 28% after the drugmaker announced a trial of a treatment for REM sleep behavior disorder wasn’t successful.

Aurora Cannabis Inc. ACB, -29.37% slid 0.4% after it said that it has entered a letter of intent to buy Mexico’s Farmacias Magistrales SA in a stock deal.

Shares of Linde Plc LIN, -2.13% climbed 2.7% after the multinational chemical company announced a $1 billion share repurchase program.

How were other markets trading?

Asian markets fell with China’s Shanghai Composite Index SHCOMP, -1.46% dropping 0.8% and the Nikkei 225 index NIK, -0.96% down 2.1%. European markets SXXP, +0.55% also declined.

U.S. crude oil US:CLF9 prices fell sharply, while gold US:GCG9 settled lower, and the U.S. dollar DXY, +0.06% climbed 0.7%.

—Barbara Kollmeyer contributed to this report