WASHINGTON — At dinner with China’s president, Xi Jinping, on Saturday night in Buenos Aires, President 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, unbeknown 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.

The Justice Department is investigating Ms. 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 Mr. 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 on 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 trade concessions described by Mr. Trump.