When Meng Wanzhou's flight landed in Vancouver on 1 December 2018, she was expecting to make only a brief stopover. But after almost a three-year prolonged stay, the chief financial officer of Huawei and daughter of the telecoms giant's founder is now a free woman.
On Friday, prosecutors announced that a request to extradite her to the US had been dropped.
During the three years of intense legal battles, Canada was caught in the escalating tension between Washington and Beijing.
At the centre of the story is a sixteen-page corporate PowerPoint presentation.
Vancouver stopover and an arrest
When her plane from Hong Kong landed, Meng Wanzhou planned to go to a house she owned in the Canadian city to collect some luggage before catching another flight to Mexico for a corporate meeting.
But instead she was questioned by Canadian border security agents for three hours as her phone was seized and luggage searched.
When that was over, she was formally admitted into Canada. It was at this point that the Royal Canadian Mounted Police moved in and arrested her because of an extradition request filed by the US.
The US wanted Ms Meng to stand trial on charges including fraud linked to the alleged violation of US sanctions against Iran, allegations she denies.
A PowerPoint at the heart of the case
The PowerPoint was used by Ms Meng at a meeting with the bank HSBC on 22 August 2013, and is seen as key evidence against her.
Reuters news reports in the preceding months had raised questions about whether there had been a breach of trade sanctions on Iran by Hong Kong-based firm Skycom.
At issue was whether Skycom, a telecoms equipment seller, was simply a business partner of Huawei's - or a front for it to conceal its activities in Iran.
The US alleged that in the meeting - the one with the PowerPoint presentation - Ms Meng misled HSBC over the true nature of Huawei's relationship with Skycom and this, in turn, put the bank at risk of violating sanctions against Iran.
Her lawyers said the US misled the court, in particular about the PowerPoint, by omitting key information on two slides which showed HSBC was not, in fact, being kept in the dark about the true nature of the Skycom/Huawei relationship.
Meng's lawyers launch legal fight
Ms Meng's lawyers launched a multi-pronged attack on the US extradition request itself.
An initial attempt to claim that the crime for which she is charged in the US is not a crime in Canada failed (although that can be appealed).
Another challenge centred on politics around the case.
Her lawyers claimed that comments made by US President Donald Trump, which indicated a willingness to use the case as a bargaining chip in trade negotiations with China, constituted an abuse of process.
Another challenge related to her treatment at the airport in Vancouver. Her lawyers argued there was an abuse of process in the way she was treated.
They fought to have certain documents disclosed, including from the Canadian Security Intelligence Service, and sought to uncover what role US officials might have played in her arrest at the time.
A judge turned down requests for some documents.
It was thought that the case could take between five and 10 years to come to a conclusion.
Last month, Ms Meng appeared in court as a judge heard the final arguments about whether to send her to the US. Her case was also raised in high-level discussions between senior US and Chinese diplomats.
Huawei executives were also in touch with the US government to try and secure her release.
And then on Friday, the US Department of Justice (DOJ) announced it had reached a deferred prosecution agreement. This means that the DOJ will hold off from prosecuting Ms Meng until late next year and if she complies with conditions set by the court, the case will eventually be dropped.
Within hours, she had left Vancouver on a plane bound for China.
The impact of the case has rippled far and wide.
The arrest of such a high-profile business figure led to anger in China. The country's ambassador said Canada had been "taken advantage of" and made an "accomplice" by America as Washington carried out a "barbaric act of bullying".
HSBC was put in a difficult position with Chinese media questioning how far the bank co-operated with the US in building the case they described as a politically driven trap.
The bank, already caught between the West and China over its stance on Hong Kong, maintained it only did what it was legally required to do and that there was no entrapment.
The case has also raised broader questions over which countries might arrest business executives if they were to receive requests from the US.
It has led to concern that Western businesspeople and other travellers could find themselves detained by China to be used as bargaining chips.
Two Canadians were detained days after Ms Meng's arrest. Michael Kovrig, a former diplomat, and Michael Spavor, a businessman, were later charged with spying.
China has denied any link but the pair's detention was widely interpreted as a direct response to Ms Meng's arrest.
Last month, a Chinese court sentenced Spavor to 11 years in prison.
Then hours after a Canadian judge ended extradition proceedings against Meng, it was revealed that China had released the two men and they were flying home.