(Bloomberg) -- A Canadian court scrapped a long-running extradition case against a top Huawei Technologies Co. executive on Friday, a major step toward resolving an unprecedented diplomatic tussle between the U.S., China and Canada that landed two Canadians in Chinese jails.

Supreme Court of British Columbia Associate Chief Justice Heather Holmes discharged Meng Wanzhou, Huawei’s chief financial officer, after Meng struck a deferred prosecution agreement with U.S. authorities to resolve criminal charges against her. 

The development paves the way for Meng -- who has been under house arrest in Vancouver since December 2018 -- to return home to China. She may already be packing her bags: when a court decision in May 2020 presented her with her first shot at release, a China Southern Airlines jetliner was chartered, ready to whisk the 49-year-old executive back to China if the decision had gone in her favor.

The long-running case became a symbol of the intensifying geopolitical rivalry between the U.S. and China, throwing into stark relief the risk faced by those who get caught in the middle. Within days of her arrest, Chinese authorities jailed two Canadians, triggering a diplomatic showdown that has cost billions of dollars in lost trade and plunged bilateral relations to their worst point in decades.

Prosecutors in Brooklyn, New York, had charged Meng with fraud, accusing her of lying to HSBC Holdings Plc about Huawei’s business dealings in Iran as part of an attempt to violate U.S. trade sanctions. Meng had denied any wrongdoing and accused the U.S. of overreach. 

Appearing by video on Friday, Meng pleaded not guilty in a Brooklyn courtroom but subsequently admitted to misleading a financial institution about Huawei’s business operations in Iran. U.S. government lawyers said they will defer prosecution in the matter and dismiss the charges entirely by Dec. 1, 2022 if Meng complies with terms of the agreement, which include refraining from saying anything that contradicts U.S. prosecutors’ states facts about the case.  

Since Meng’s arrest during an airport stopover in Vancouver, her case has emerged as part of a broader effort by the U.S. government to contain Huawei, which Washington has designated a national security threat. The Chinese Communist Party, in turn, saw the pursuit of Meng -- the eldest daughter of Huawei’s powerful founder -- as a politically motivated attack on one of its chief technology champions.

What transpires next with the jailed Canadians -- Michael Spavor and Michael Kovrig -- will be critical for Canadian Prime Minister Justin Trudeau, just days after a national election in which he faced stiff criticism from the rival Conservatives over his handling of relations with Beijing. 

China has repeatedly linked the cases of the two Michaels, as they are known in Canada, to Meng’s, with a Foreign Ministry spokesman saying last year that halting her extradition “could open up space for resolution to the situation of the two Canadians.”

In an earlier extradition case, when Canadian authorities arrested Chinese millionaire Su Bin in a Vancouver suburb in 2014, China swiftly jailed a Canadian, Kevin Garratt. Kevin was imprisoned for more than two years before he was deported about six months after Su agreed to a plea bargain with U.S. authorities.

Spavor, a Canadian tour organizer, was sentenced last month to 11 years for spying. There has not yet been a verdict for Kovrig -- a Hong Kong-based analyst at the International Crisis Group and former Canadian diplomat -- who was arrested the same day as Spavor. The two men have been detained more than 1,000 days.

©2021 Bloomberg L.P.