OTTAWA - Dominic Barton has tendered his resignation as ambassador to China after two tense years in which he was praised for helping secure the release of two Canadians from Chinese custody, and criticized for strongly pushing closer trade ties with Beijing.

Prime Minister Justin Trudeau announced Barton's pending departure on Monday morning, saying the former business executive will officially leave at the end of the year.

“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 a 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.”

The announcement comes three months after the release of two Canadians - Michael Kovrig and Michael Spavor - who were first arrested and detained in December 2018 by Chinese authorities.

Their detention in Chinese prison was in apparent retaliation for Canadian officials having arrested Huawei executive Meng Wanzhou, who was wanted in the U.S. on fraud charges.

The case of the two Michaels dominated Barton's tenure as Canada's top diplomat in Beijing.

In a statement, Barton said the release of the two Michaels was his “core priority” when he was appointed by Trudeau.

“Working to secure Michael Kovrig and Michael Spavor's release has been one of the most significant events in my life and I have been incredibly moved by the bravery and resilience of these two men, as well as their families,” he said.

“It was the honour of a lifetime to help with their release and I am extremely proud of the many Canadian public servants who helped bring them home.”

Barton said his successor “will be on a strong footing” to strengthen Canada's relationship with China, “build on our people-to-people relations, trade and investment ties, while continuing to stand firm on human rights and the rule of law and addressing outstanding consular and market access issues that exist.”

Trudeau lauded Barton for securing the release of the two Michaels.

“As a defender of human rights and the rule of law, his top priority always remained securing the release of Michael Kovrig and Michael Spavor, who had been arbitrarily detained in China for two and a half years,” the prime minister said.

“He worked tirelessly on this important task. … Thanks to Dominic's leadership and skilled diplomatic approach, Michael Kovrig and Michael Spavor are back at home with their families.”

The two Michaels were released from Chinese detention and flown back to Canada in September, hours after Meng entered into a deferred prosecution agreement with the U.S. that saw her released from Canadian custody and returned to China.

Yet Barton, who previously served as a top executive with global consulting firm McKinsey and Co., was also criticized for pushing greater trade ties with China while the two Michaels were detained, and despite Beijing's increasingly authoritarian bent.

“Mr. Barton was an ineffective Canadian envoy because he lacked understanding or even interest in the non-trade diplomat aspects of Canada-China relations,” said Charles Burton, who served two stints as a diplomat at the Canadian Embassy in Beijing.

Burton, who is now a senior fellow with the Macdonald-Laurier Institute, also accused the ambassador of having been ineffective in pushing China to release Kovrig and Spavor, or letting the two Canadians receive consular access.

Canadian officials previously complained that China was not abiding to its international obligations by limiting diplomatic access to the two Michaels.

Former Canadian ambassador to China David Mulroney, who has been critical of the Liberal government's handling of China in recent years, was critical of Barton's approach as well as that of his predecessor, John McCallum.

McCallum, who served in cabinet under several Liberal prime ministers including Trudeau, resigned abruptly in January 2019 after listing several arguments he thought could help Meng's fight against extradition in a discussion with Chinese-language journalists.

“We've had two ambassadors who appeared to reflect the PM's unchanging, highly positive take on China,” Mulroney said on Twitter.

He added Trudeau “needs to understand, finally, that we don't need a promoter, but someone can help deliver a smart and realistic China policy that addresses the growing risk we face.”

While Conservative Leader Erin O'Toole thanked Barton for his service, he also accused the Liberal government of having mishandled Canada's relationship from the start.

“What we need to have is a principle-based approach that shows that our economic interests in China will not dominate our concerns about human rights, whether for the Uighurs, the situation in Hong Kong, tensions with respect to Taiwan,” he said.

“And I would hope, Mr. Trudeau puts a professional experienced diplomat in that post, not a friend of the Liberal party.”

Meanwhile, questions have surfaced in the U.S. over McKinsey's relationship with China as the multinational company, where Barton was managing director for nearly a decade, has also been working with the American military.

That has prompted concerns about a potential conflict of interest for the company, particularly as tensions between the U.S. and China heat up.

While the release of Meng and the two Michaels ended the most contentious dispute between Canada and China in years, the Liberal government continues to wrestle with a number of sensitive but important issues in the relationship.

That includes whether to let Huawei participate in Canada's 5G wireless network, the extent to which Canadian universities will be allowed to work with Chinese entities, and how to respond to China's aggressive stance on the world stage.

The Liberals promised during the election to launch an Asia-Pacific strategy for the region, emphasizing the importance of building new trade ties and expanding existing ones while also referencing greater diplomatic and military relationships in the area.

They touched on that promise in last month's throne speech, which did not specifically mention China but did note a rise in authoritarianism and “great power competition,” and referenced deepening partnerships in the Indo-Pacific.

Trudeau in his statement praised Barton for having helped shape Canada's ties and priorities with China, saying: “Thanks to his efforts, Canada is now better positioned to manage this important relationship and achieve our diplomatic objectives.”

This report by The Canadian Press was first published Dec. 6, 2021.