NEW YORK (Reuters) - U.S. stocks closed higher on Wednesday as reports that U.S. President Donald Trump would hold off on imposing tariffs on imported cars and parts eased growth concerns even as economic data disappointed investors.

All three major U.S. indexes saw their second straight day of gains following Monday’s steep sell-off, but the S&P 500 remained more than 3% below its all-time high reached just over two weeks ago.

The prospect of a six-month postponement of tariffs on imported autos and auto parts, along with Treasury Secretary Steven Mnuchin’s remarks that he expects trade talks to resume soon in China, was welcome news to investors, who started the session in a selling mood after the underwhelming economic reports.

Retail sales posted a surprise drop in April as consumers pulled back on their spending, according to the U.S. Commerce Department. A separate report from the Labor Department showed U.S. industrial production also unexpectedly dipped in April.

“(Investors are) taking their cues from the president and the treasury secretary as a bit of a softening on trade negotiations,” said Robert Pavlik, chief investment strategist, senior portfolio manager at SlateStone Wealth LLC in New York. “That’s giving the market reason to believe that a trade deal is somewhere in the offing.”

“Investors have gotten into this pattern of knee-jerk reactions,” Pavlik continued. “It’s almost as if you light a fire cracker and the dog goes running off and then realizes it’s not so bad and starts to come back in.”

The Dow Jones Industrial Average rose 115.97 points, or 0.45%, to 25,648.02, the S&P 500 gained 16.55 points, or 0.58%, to 2,850.96 and the Nasdaq Composite added 87.65 points, or 1.13%, to 7,822.15.

FILE PHOTO: Traders work on the floor at the New York Stock Exchange (NYSE) in New York, U.S., May 14, 2019. REUTERS/Brendan McDermid

Of the 11 major sectors in the S&P 500, eight ended the session in positive territory, with communications services enjoying the largest percentage gain, led by Alphabet Inc and Facebook Inc.

With 455 of S&P 500 companies having posted results, first-quarter earnings season is winding down. Of those who have reported, 75.2% have bested expectations.

Analysts now see first-quarter earnings growth of 1.2%, a significant turnaround from the 2% loss seen on April 1.

Macy’s Inc dipped 0.5% after the department store beat quarterly expectations but said the recent tariff hikes on Chinese goods will hurt its furniture business.

Agilent Technologies Inc was the worst performer of the S&P 500, falling 11.0% after the medical equipment maker reported quarterly profit that fell short of consensus estimates.

Ride-hailing rivals Uber Technologies Inc and Lyft Inc saw their second straight day of gains following their underwhelming post-debut performances. Their shares advanced 3.3% and 7.0%, respectively.

Cisco Systems Inc shares rose more than 3% in after-market trading following the company’s earnings release.

Walmart Inc is expected report before the market opens on Thursday.

Advancing issues outnumbered declining ones on the NYSE by a 2.05-to-1 ratio; on Nasdaq, a 1.48-to-1 ratio favored advancers.

The S&P 500 posted 23 new 52-week highs and 12 new lows; the Nasdaq Composite recorded 64 new highs and 76 new lows.

Volume on U.S. exchanges was 6.29 billion shares, compared to the 7.00 billion average over the last 20 trading days.