U.S. stocks closed higher Wednesday, with the S&P 500 posting its highest close in more than four months, as investors parsed economic data that included stronger-than-expected durable goods orders and further signs that inflation remains subdued.

Shares of Boeing ended a seven-day losing streak despite continued concerns about the safety of its cutting edge 737 Max 8 continued unabated following the second deadly crash involving the model in Ethiopia over the weekend.

The Dow Jones Industrial Average DJIA, -1.28% climbed 148.23 points, or 0.6%, to 25,702.89. The S&P 500 index SPX, -1.60% added 19.40 points, or 0.7%, to end at 2,810.92, its highest close since Nov. 7. The Nasdaq Composite Index COMP, -2.20% advanced 52.37 points, or 0.7%, at 7,643.41.

What drove the market?

Boeing Co. BA, -2.41% shares rose 0.5%. President Donald Trump told reporters that U.S. regulators will ground 737 Max 8 and 9 aircraft in line with similar decisions in other countries. However, industry experts said that although Boeing’s reputation will suffer, the latest incidents are not likely to have a lasting impact on the company. Boeing shares are down more than 14% so far this month.

On the economic front, U.S. durable goods orders came in surprisingly strong, following previous reports showing a sharp slowdown in business investment.

The Commerce Department report also showed core capital orders, a key measure of business investment, rising 0.8% in January after falling sharply the two months previous.

The cost of wholesale goods rose 0.1% in February, below the 0.2% increase expected by economists, per a MarketWatch poll. The 12-month increase in producer prices fell from 2.5% to 2.3%, well below last summer’s peak of 3% growth.

U.S. construction spending increased 1.3% in January, the largest increase since April, after a 0.8% decrease in December, the Commerce Department said.

The U.K. Parliament on Wednesday voted against a no-deal Brexit, a day after lawmakers rejected Prime Minister Theresa May’s revised Brexit deal in a 242-391 vote. On Thursday, they will decide on whether to request an extension to the March 29 deadline to reach a trade agreement with the European Union.

Meanwhile, Trump said Wednesday that he is not in a hurry to hammer out a trade deal with China and that Chinese President Xi Jinping knows that the U.S. can walk away from bilateral talks if an agreement isn’t reached, The Wall Street Journal reported. Negotiations between the two sides have turned more intense this week, with the U.S. and China working to remove last “stumbling blocks,” according to the newspaper.

What were strategists saying?

“The rebound in underlying capital goods orders in January is still consistent with a slowdown in business equipment investment growth in the first quarter, although it suggests that slowdown won’t be as sharp as signaled by some of the incoming survey evidence,” wrote Michael Pearce senior U.S. economist with Capital Economics in a note.

“With the February producer price figures showing few signs of a pickup in inflation in the pipeline, there is still a strong case for the Fed to remain patient,” he added.

Which stocks were in focus?

Shares of Rite Aid Corp. RAD, -1.18% rallied 6.1% after the drugstore chain’s chief executive, John Standley, said he would step down.

Shares of Express Inc. EXPR, -5.81% sank 10% after the fashion apparel retailer beat fourth-quarter profit expectations but missed on net sales and provided first-quarter outlook that was worse than forecasts.

Take-Two Interactive Software TTWO, -1.76% shares jumped 6.9%, its best day since October 2018. Joel Kulina, head of technology and media trading at Wedbush Securities, referenced rumors about potential takeover interest from Sony Corp. SNE, -1.44% in a note to clients.

Shares of Insys Therapeutics Inc. US:INSY skidded 25% after the opioid maker disclosed in a securities filing that an auditor had raised doubt about its ability to continue as a going concern. The company’s founder, John Kapoor, and several former executives have been accused of bribing medical personnel to prescribe its drug Subsys, a sublingual fentanyl spray approved by the FDA for cancer-related pain.

How were other markets trading?

Asian markets closed lower, with Japan’s Nikkei 225 NIK, -0.05% losing 1%, Hong Kong’s Hang Seng Index HSI, +0.10% shedding 0.4% and China’s Shanghai Composite Index SHCOMP, +0.16% retreating 1.1%.

European stocks were higher, with the Stoxx Europe 600 SXXP, +0.55% rising 0.6%.

The price of oil US:CLJ9 continued to rise, while gold US:GCJ9 settled higher and the U.S. dollar DXY, +0.30% retreated against peers.

—Mark DeCambre contributed to this article