Huawei Technologies Co. Chief Financial Officer Meng Wanzhou was set free by a Canadian judge Friday, just a few hours after the unveiling of a deferred prosecution agreement with U.S. prosecutors on fraud charges tied to alleged violations of sanctions against Iran.

The deal will allow Meng to return home to China, possibly ending a nearly three-year dispute between the world's two biggest economies that has seen Canada caught in the middle. 
Meng appeared virtually in a U.S. federal court presided by U.S. District Judge Ann M. Donnelly on Friday to resolve the charges that led to her arrest at Vancouver International Airport in December 2018 at the behest of the United States. 
As part of the deferred prosecution agreement, Meng agreed to a statement of facts in regards to Huawei violating U.S. sanctions by misleading banks in 2013 about the telecommunications company’s ties to Iran. 

In return, U.S. Justice officials agreed to defer Meng's case until Dec. 1, 2022 and will later drop wire and bank fraud charges laid against her. They also withdrew an extradition request for Meng to Canadian authorities. 

Shortly after 2 p.m. Pacific time, Justice Heather Holmes of the B.C. Supreme Court discharged Meng.

“Canada is a rule of law country. Meng Wanzhou was afforded a fair process before the courts in accordance with Canadian law. This speaks to the independence of Canada's judicial system,” said the Department of Justice Canada in a statement.

The statement of facts in the deferred prosecution agreement details how a Hong Kong-based Huawei subsidiary known as Skycom Tech Co. Ltd operated in Iran between 2010 and 2014. Meng sat on Skycom's board between Feb. 2008 to Apr. 2009 and all "significant" business decisions were made by Huawei. 

"Moreover, Skycom’s country manager—the head of the business—was a Huawei employee. Individuals employed by Skycom believed they worked for Huawei. Indeed, Skycom employees used email addresses with the domain ','" according to the statement of facts. 

After media reports detailed the relationship between Huawei and Skycom, Meng met with an executive from an unnamed financial institution to state that Huawei’s relationship with Skycom was "normal business cooperation" and described the subsidiary as a "partner" and "third party Huawei works with" in Iran. 

She went on to state that Huawei operates in Iran "in strict compliance with applicable laws, regulations and sanctions" and that "there has been no violation of export control regulations." Those statements were untrue, according to the statement of facts that Meng agreed to. 

If Meng doesn't comply with the obligations set in the agreement, she could be prosecuted again under those charges, a U.S. Justice official told the court. 

Meng's lawyer, William W. Taylor, said in a statement that he is "very pleased" that his client and the U.S. Department of Justice were able to strike a deferred prosecution agreement and that extradition proceedings in Canada will now be terminated. "She has not pleaded guilty and we fully expect the indictment will be dismissed with prejudice after fourteen months. Now, she will be free to return home to be with her family," Taylor said. 

Late Friday Prime Minister Justin Trudeau said Canadian citizens Michael Kovrig and Michael Spavor are on their way back to Canada. The two Canadians were detained in China in December 2018 in a move that was widely viewed as retribution for the Huawei executive's arrest.

Trudeau told a news conference on Parliament Hill that Kovrig and Spavor, who have become known in Canada and around the world as the “two Michaels,” were on a plane that left China, accompanied by Canadian ambassador Dominic Barton.

With files from Noah Zivitz and The Canadian Press