By Mark Landler, Edward Wong and Katie Benner

New York Times News Service

WASHINGTON — At dinner with China’s president, Xi Jinping, on Saturday night in Buenos Aires, Argentina, President Donald Trump celebrated their “special” relationship and all but predicted they would emerge with a truce in the trade war between the United States and China.

Seven thousand miles away, unbeknownst to both leaders, Canadian police acting at the request of the United States were in the process of detaining Meng ­Wanzhou, a top executive of one of China’s flagship technology firms, as she changed planes in Vancouver, British Columbia.

The Justice Department is investigating Meng’s company, Huawei, on charges of violating sanctions on Iran, and her arrest was meant as a warning shot by the Trump administration in its campaign to limit the global spread of Chinese technology. But it has thrown Trump’s trade negotiations with Beijing into disarray, drawing a sharp protest from the Chinese government and sending financial markets into a panicky swoon, before a modest recovery Thursday afternoon.

The timing of the arrest, some experts said, could feed the suspicion of Chinese officials that nationalist factions in the Trump administration were trying to sabotage the trade deal. Their mood had already soured since Saturday, when the White House announced the two sides had agreed to 90 days of talks, amid confusion over the timetable and doubts that the Chinese would agree to the tariff reductions described by Trump.

“To detain someone without giving clear reason is an obvious violation of human rights,” said Geng Shuang, a spokesman for China’s Foreign Ministry, who demanded Meng’s immediate release.

For Xi, these experts said, the episode might be seen as an embarrassing loss of face.

Huawei and Meng, who in addition to being the company’s chief financial officer is the daughter of its founder, are at the pinnacle of China’s corporate world, which will increase the pressure on Xi to demand her release. It will also increase the pressure on Trump to weigh the diplomatic fallout of detaining Meng, especially after a meeting he hailed as a breakthrough and a testament to his friendship with Xi.

The United States and China have carried on trade negotiations amid such tensions before. Talks continued this year as the administration was planning to punish ZTE, another Chinese technology company that violated U.S. sanctions, though Trump ultimately offered it a reprieve.

“In the past, the United States has been faced with making a deal with China in one arena while being irritated or highly concerned about others, such as human rights or security,” said Scott Kennedy, a China expert at the Center for Strategic and International Studies. “The shoe is now on the other foot, and we will have to see if China can compartmentalize this case.”

For U.S. officials and the White House, the fact that Trump went into the meeting without knowing about the arrest raised questions about whether the president was properly briefed before a sensitive meeting with a foreign leader.

While the Justice Department did brief the White House about the impending arrest, Trump was not told about it. And the subject did not come up at the dinner with Xi.

Trump’s national security adviser, John Bolton, said on NPR that he knew about the arrest in advance, though he did not confirm that he was told about it before the dinner. Such notifications from the Justice Department “happen with some frequency,” he said, and “we certainly don’t inform the president on every one of them.”

But the Justice Department did give advance notification to the chairman of the Senate Intelligence Committee, Sen. Richard M. Burr, R-N.C., and its ranking Democrat, Sen. Mark Warner of Virginia, according to two officials.

Former U.S. officials said the awkward timing of it was likely a coincidence that grew out of the unpredictable travel schedule of Meng.

“When you have an opportunity to arrest a key figure in a law enforcement operation, you take that opportunity,” said John E. Smith, former director of Treasury’s Office of Foreign Assets Control, who left the administration this year.

Still, given the magnitude of the arrest and the country involved, Smith expressed surprise that the White House officials contacted by the Justice Department did not immediately tell higher-­level officials, who could at least tip off the president.

The Justice Department has not revealed what Huawei was doing to run afoul of the sanctions. Chinese companies regularly do business in Iran, and much of that trade complies with sanctions regulations. The question appears to be whether Huawei sold technology from the United States to Iran or in some other manner.

While the case involving Meng is related to the unauthorized sale of equipment that could violate sanctions against Iran, FBI counterintelligence agents and federal prosecutors began building criminal cases against Huawei’s leadership in 2010, according to a former department official.

Trump has emphasized curbing China’s rise as a technological power, increasingly linking trade with national security. The White House has restricted Chinese investment in the United States and hit China with tariffs on $250 billion worth of Chinese goods, including sensitive products like parts for nuclear reactors and semiconductors.

“In the past, we have dealt with these cases by interrupting the legal process to avoid offending the Chinese Communist Party,” said Robert Spalding, a retired Air Force general who worked on China issues at the National Security Council until January. “That is what has made geopolitics so challenging to American interests in the last 20 years.”