U.S. stock markets eked out a small win Monday after posting big, early losses after Britain’s political crisis around Brexit clouded investors’ outlook, with British Prime Minister Theresa May putting off a key parliamentary vote on her country’s exit from the European Union.

Investors were also on edge about developments in the U.S.-China trade dispute.

In a grim turn in morning trading, the Dow Jones industrial average dropped more than 500 points — or 2 percent. By day’s end, it had climbed back into positive territory, up 34 points, or 0.1 percent, to 24,423.26.

Markets were initially dragged lower by banks and Apple. The iPhone maker was ordered by a Chinese court to stop selling some of its late-model phones in the country after a ruling that it had infringed on patents held by Qualcomm.

British Prime Minister Theresa May announced Dec. 10 that a Parliament vote on the Brexit deal with Europe expected for the next day would be postponed. (Reuters)

The Standard & Poor’s 500-stock index finished up 0.2 percent, and the Nasdaq composite had pulled into positive territory, up 0.7 percent.

Stocks were whipsawed, first driven down by the Brexit news. The lows came around 11 a.m., driven down by lagging financials and by energy stocks hobbled by lower oil prices. The market began lifting in the early afternoon. Technology stocks followed Apple, which started the day in a funk, and then rallied higher around noon.

CNBC reporter Bob Pisani said there was no apparent cause for the rebound, terming the Apple-led rally a “thin gruel.”

By the end, Facebook shares were up nearly 3 percent, Microsoft was up 2.6 percent and Intel was up 2.1 percent.

Pro-Brexit protesters marched in London Dec. 9. They held signs decrying a deal Prime Minister Theresa May struck with Europe, which faces a vote in Parliament. (AP)

“The turnaround was a result of bargain hunters finally starting to sniff around and pick up some attractive buys, particularly in the tech space,” said Kristina Hooper, global market strategist at Invesco. “Tech is particularly popular because it has fallen so much” in recent months.

Daniel P. Wiener, chairman of Newton, Mass.-based Adviser Investments, said the market is being moved by day traders responding to every nuance in the news and the marketplace.

“This is one of those headline moments when it’s easier to sell than it is to think about being an investor,” Wiener said. “Traders respond to every news blip. They are measured on their day-to-day performance. They are affecting this market. Investors have a long-term horizon and look at this relatively significant downturn and consider making purchases.”

Kenny Polcari of Butcher­Joseph Asset Management said the latest brouhaha over Brexit piles onto the worries that have beset markets in recent weeks.

“The market has been focusing on all the negative stories,” Polcari said. “As long as the tone is negative, any negative story is going to cause a market overreaction. Brexit is certainly one of them. All of a sudden, Brexit has a real speed bump.”

Tensions over the U.S.-China trade dispute pitched higher over the weekend, too. U.S. Trade Representative Robert E. Lighthizer said Sunday on CBS’s “Face the Nation” that March 1 is “a hard deadline” to reach a deal.

“The way this is set up is that at the end of 90 days, these tariffs will be raised,” he said. “If [a deal] can be done, the president wants us to do it. If not, we’ll have tariffs.”

Another flash point in the U.S.-China trade relationship was the arrest last week of Meng Wanzhou, the chief financial officer of China’s Huawei Technologies. Meng was detained Dec. 1 in Vancouver, B.C. The United States wants to extradite Meng on charges of violating U.S. sanctions on Iran.

Lighthizer attempted to separate the trade debate from the arrest, calling it “a criminal-justice matter.” Yet it has still darkened the cloud over trade talks.

China has demanded Meng’s release and summoned U.S. Ambassador Terry Branstad to Beijing to register its unhappiness with the arrest. The Chinese government also has threatened “further actions” on the matter, according to a posting on a Chinese government website.

Bank stocks were also dropping Monday on weekend reports out of China that showed November exports and imports were below expectations. Soft trade could signal weaker global economic growth.

Asian and Australian banks were down on the news of China’s weaker trade, and the same fears were felt in the U.S. banking sector. The financial sector of the S&P 500 was among the hardest-hit Monday, down 2.8 percent at noon.

JPMorgan Chase was down nearly 2 percent Monday, followed by American Express, down 1.8 percent.

Stocks were also dragged lower by energy, which fell 3.4 percent after oil prices kept up their months-long decline. The global market is awash in oil, which has sent prices on a 30 percent swoon since October.

U.S. crude oil was down more than 3 percent Monday, despite an agreement Friday between the Organization of the Petroleum Exporting Countries and non-OPEC allies, including Russia, to cap production in an effort to stabilize prices.

In Britain, May’s announcement came just months before the British are scheduled to leave the European Union and has thrown her government into disarray. Uncertainty surrounding Britain’s exit from the E.U. has roiled the economies of Europe and Britain.

The crisis has punished the British pound, which dropped 1.8 percent Monday, to the currency’s lowest level since April 2017. It is closer to parity with the dollar, trading at $1.25 to a pound.