The 2018 arrest in Vancouver of Huawei chief financial officer Meng Wanzhou on a US warrant, followed by China's detention of two Canadians, sparked an unprecedented dispute between Beijing and Ottawa.

On Friday, a legal agreement in New York paved the way for Meng to board a plane to China after nearly three years of detention in Canada and for the two Canadian men to also set off home.

Here are the key dates in the case:

In August 2018, a New York court issues an arrest warrant for Meng, Chinese telecommunications giant Huawei's number two, dubbed the "Princess of Huawei."

The US justice department accuses Meng -- the daughter of Huawei founder Ren Zhengfei -- of having lied to HSBC about Huawei's relationship with its Iran-based covert subsidiary Skycom, putting the bank at risk of violating US sanctions against Iran.

On December 1, Meng is arrested at the request of US authorities as she changes planes in Vancouver.

On December 6, Canadian Prime Minister Justin Trudeau says there was no "political intervention" and that Canada's judicial system is acting independently in dealing with the US extradition request.

Two days later, on December 8, China threatens Canada with severe consequences.

On December 10, China detains former diplomat Michael Kovrig, who was employed by the International Crisis Group think tank, and business consultant Michael Spavor under suspicion of "engaging in activities that threatened China's national security."

The arrests are widely seen by observers as retaliation for Meng's detention.

In January 2019, Trudeau and then US president Donald Trump denounce China's "arbitrary detention" of the two Canadians.

Later that month, Trudeau dismisses Canada's ambassador to China, John McCallum, for saying in an interview with Chinese media that Meng had solid grounds to contest her extradition to the United States.

Huawei chief financial officer Meng Wanzhou leaves court with her security detail in August 2021, in Vancouver, Canada, after an extradition hearing
Huawei chief financial officer Meng Wanzhou leaves court with her security detail in August 2021, in Vancouver, Canada, after an extradition hearing AFP / Don MacKinnon

Also in January 2019, diplomatic tensions heighten when a court in northeast China sentences Canadian Robert Lloyd Schellenberg, 36, to death at a hastily scheduled retrial after his previous 15-year prison term for drug trafficking was deemed too lenient.

Schellenberg was detained well before the diplomatic feud, back in 2014.

Following the death sentence, Canada updates its travel advisory for China, warning citizens of the "risk of arbitrary enforcement of local laws."

In response, China warned its citizens of the "risks" of travel to Canada citing Meng's arrest.

In March 2019, Beijing cites "hazardous pests" found in Canadian shipments of canola to justify a ban on imports of the seed used to make cooking oil, biodiesel and animal feed.

In June, China suspends all imports of Canadian beef and pork, saying it had uncovered false veterinary health certificates.

In November, Beijing announces it will resume Canadian meat imports.

In June 2020, China formally charges Kovrig and Spavor, more than 18 months after their arrests.

The Supreme People's Procuratorate says they are "suspected of foreign espionage" and "providing state secrets."

In January 2021, Meng's lawyers ask a court to ease her bail conditions, which include a curfew, an ankle bracelet, and daytime supervision by security guards at the Vancouver mansion where she has lived since her arrest.

The judge sides with government lawyers who objected.

Kovrig and Spavor are tried in March. Spavor is sentenced to 11 years in prison in China. No outcome is yet announced in Kovrig's case.

On September 24, Meng reaches a deal with US prosecutors to avoid felony fraud charges, and is granted release in a Vancouver court hearing. She quickly leaves for the Chinese city of Shenzhen.

Shortly afterwards, Trudeau announces that the two Canadians, Kovrig and Spavor, are headed home to Canada after being released by China.