Dominic Barton, Canada’s ambassador to China, is stepping down from his post at the end of this year, according to a statement by Prime Minister Justin Trudeau.

Barton, a former global managing partner of McKinsey & Co. Inc., has been at the post since September 2019. He’s leaving only weeks after the resolution of a diplomatic crisis between China and Canada in September, when Beijing released two jailed Canadians who had been held for nearly three years. The move came hours after a top Huawei Technologies Co. executive, Meng Wanzhou, was freed from house arrest in Vancouver and returned home.

“With much gratitude and respect, I have accepted Ambassador Barton’s decision to leave his post in Beijing at the end of the year,” Trudeau said in the emailed statement. “For the last two years, Dominic has led our team in China with determination, integrity, and compassion, and at a time when relations between our two countries faced difficult challenges.”

During Barton’s tenure, ties between the two countries reached their most fraught point in decades amid an impasse over the arrests. For nearly three years, Meng -- Huawei’s chief financial officer -- was battling extradition to the U.S. on fraud charges in an Iran sanctions case. 

Michael Kovrig, a former diplomat, and entrepreneur Michael Spavor were detained within days of Meng’s December 2018 arrest and languished in Chinese jails until their release.  

Meng was freed Sept. 24 after she struck a deferred prosecution agreement with U.S. authorities to resolve criminal charges against her.