Stocks recovered much of an early swoon and ended moderately lower as a midnight deadline approached for the U.S. and China to reach a trade deal and more in Thursday’s Stock Market Update.

Tensions between the world’s two largest economies are dragging down stocks from Mumbai to Milan as a deadline of 12:01 a.m. Eastern time Friday approaches, when the United States said it would impose more tariffs on Chinese goods. The worries about trade have halted what has been the hottest start to a year for U.S. stocks in decades, and the S&P 500 index is on pace for its worst week of 2019.

Technology companies fell the most. Intel lost 5.3%.

Thursday’s sell-off began steep and widespread, but lost some momentum by afternoon, allowing the market to stem some of its losses.

Still, analysts said the market was likely in for more pain until the uncertainty over the costly trade dispute is resolved.

“China and trade remain the biggest drag and the biggest overhang for the market,” said Ben Phillips, chief investment officer at EventShares. “If there’s not a deal within the next four to six weeks, the market is going to continue to be under pressure and sell off.”

DAILY STOCK MARKET UPDATE

KEEPING SCORE: The S&P 500 fell 8 points, or 0.3%, to 2,870. The index is headed for its biggest weekly loss of the year, and has given back all of the gains it made in April.

The Dow Jones Industrial Average lost 138 points, or 0.5%, to 25,828. It was down almost 450 points earlier.

The Nasdaq fell 32 points, or 0.4%, to 7,910.

Major indexes in Europe and Asia finished lower.

The U.S. government has filed plans to raise tariffs on $200 billion worth of Chinese imports from 10% to 25%. The Trump administration has also threatened to extend 25% tariffs to another $325 billion in Chinese imports, covering everything China ships to the United States.

If the increases take effect as planned, Beijing will impose “necessary countermeasures,” the Commerce Ministry said. It gave no details, but a ministry spokesman said Beijing has made “all necessary preparations,” suggesting it might be bracing for a worsening conflict.

Such moves would mark a sharp escalation in the trade dispute that has raised prices on goods for consumers and companies.

Negotiations are scheduled to continue in Washington on Thursday and to include China’s top trade official, raising some hopes in the markets that there will be a last-minute deal to prevent another round of tariffs.

Technology stocks took sharp losses. Many companies in the sector get much of their revenue from China. The sector slid 0.9%.

Raw material producers also took heavy losses. Real estate stocks eked out a slight gain.

Occidental Petroleum tumbled 6.4% after Chevron pulled out of a potential bidding war with the company to buy Anadarko. Energy companies also fell with the price of oil, as benchmark U.S. crude dropped 0.7% to settle at $61.70 per barrel. Brent crude, the international standard, closed essentially flat at $70.39 per barrel.

CenturyLink skidded 4.9% after the communications provider reported slightly weaker revenue for the latest quarter than analysts expected.

Investors bid up shares in Tapestry after the maker of Kate Spade and Coach handbags beat first quarter profit forecasts and announced a $1 billion stock buyback plan. The stock vaulted 8.4%, the biggest gainer in the S&P 500.

The trade war between Washington and Beijing is nothing new. The U.S. and China have already raised tariffs on tens of billions of dollars of each other’s goods in their dispute over U.S. complaints about Beijing’s industrial and technology policies and a perennial U.S. deficit in trade with China.

But earlier this year, investors were growing increasingly confident that the two sides would eventually find a deal on trade. That helped to calm markets following a tumultuous end to 2018, and the S&P 500 rallied back to a record despite the trade dispute.

A more patient Federal Reserve, which said it may not raise interest rates at all this year, also helped to clear worries about a possible recession, and the S&P 500 vaulted 17.5% higher in the first four months of the year.

But the calm shattered earlier this week after the United States set the Friday deadline for adding more tariffs.

“We need to be prepared for continuing uncertainty in the trade war,” said Kristina Hooper, chief global market strategist at Invesco.

Investors prematurely priced a resolution into the markets, she said, and now it’s likely the additional tariffs will be applied. She said investors still want to believe that a positive resolution is possible and any progress in the negotiations now could “create something of a rally or certainly help stabilize stocks.”

© The Associated Press. All rights reserved.