China lashed out at Canada after Justin Trudeau said the northern nation would stand up to Beijing’s “coercive diplomacy.”

The rebuke, delivered at a daily foreign ministry briefing, marred the 50th anniversary of diplomatic relations between the two countries, established by the Canadian prime minister’s late father, Pierre Elliott Trudeau.

“We firmly deplore and oppose the Canadian side deliberately confusing right and wrong and once again making erroneous comments, and we have lodged stern representations,” spokesman Zhao Lijian told reporters Wednesday.

A day earlier in Ottawa, Trudeau said Canada would work with its allies to steer the Chinese government off the aggressive foreign-affairs trail it’s blazing under President Xi Jinping.

Relations between the two countries soured after the 2018 arrest of a top Huawei Technolgoies Co. Ltd. executive in Vancouver on a U.S. extradition request. In the weeks that followed, China locked up two Canadians on national-security charges and halted billions of dollars in agricultural imports.

Wednesday’s formal complaint “is fairly standard Chinese hyperbole, something that gets more strident the more outrageous China’s behavior is,” according to David Mulroney, who served as Canadian ambassador in Beijing from 2009 to 2012.

“It’s also a good sign that Canada’s stronger tone is having an impact,” he said by email. “Despite all the bluster, China worries when countries call its bluff.”

The Chinese government allowed personnel from the Canadian embassy to hold virtual talks this week with Michael Kovrig and Michael Spavor, who were indicted this summer on spying charges.

Last week, Meng Wanzhou -- chief financial officer at state-championed Huawei and eldest daughter of its billionaire founder -- lost her bid to unseal confidential Canadian files pertaining to her fight against U.S. extradition.