VANCOUVER -- China has detained a former Canadian diplomat in Beijing in apparent retaliation for the jailing of a top Chinese executive at the request of the United States, escalating a legal and diplomatic wrangle between the three countries.

Relations were shaken by Canada's arrest of Meng Wanzhou, chief financial officer of Chinese telecommunications giant Huawei and daughter of its founder. Canadian authorities detained Meng on Dec. 1 during a layover at the Vancouver airport. The U.S. accuses Huawei of violating American economic sanctions against Iran.

The Huawei case has threatened to complicate U.S.-China efforts to resolve a bitter trade dispute -- though the two countries signalled Tuesday they are preparing to resume talks.

Heightening tension between China and Canada, Canadian Public Safety Minister Ralph Goodale confirmed Tuesday that a former Canadian diplomat had been detained in Beijing. The detention came after China warned Canada of consequences for Meng's arrest.

"We're deeply concerned," said Goodale, who did not identify the former diplomat. "A Canadian is obviously in difficulty in China. ... We are sparing no effort to do everything we possibly can to look after his safety."

Michael Kovrig, who previously worked as a diplomat in Beijing, Hong Kong and the United Nations, was taken into custody Monday night during one of his regular visits to Beijing, according to a person familiar with the matter. Kovrig is now based in Hong Kong as North East Asia adviser for the International Crisis Group.

Canada had been bracing for retaliation for Meng' arrest. The Canadian province of British Columbia cancelled a trade mission to China amid fears China could detain Canadians to put pressure on Ottawa over Meng's detention.

Former Canadian Liberal leader Bob Rae said it's clear why Kovrig was detained, declaring in a tweet: "It's called repression and retaliation."

In Vancouver, meanwhile, Meng appeared in court for a third day Tuesday as she sought release on bail.

Meng's lawyer, David Martin, said his team had worked through the night to satisfy concerns about the Chinese executive's potential release.

Martin said they contacted four people willing to put up money to guarantee that Meng won't flee. One is a real-estate agent who met Meng in 2009 and sold two properties to her and her husband. The man has pledged his home, valued at $1.8 million Canadian (US$1.3 million), and says he understands he would lose it if Meng violated the conditions of her release.

Another said he got to know Meng while working at Huawei in China in the mid-1990s. He said he vouches for Meng's character to comply with any conditions imposed by the British Columbia Supreme Court and has pledged $500,000 Canadian (US$373,000) from the equity on his home in Vancouver, which is valued at $1.4 million (US$1 million).

Justice William Ehrcke had questioned whether Meng's husband can offer a financial guarantee for his wife because he is not a resident of British Columbia as required and is on a visitor's visa that expires in February.

Meng has denied the U.S. allegations through her lawyer in court, promising to fight them if she is extradited to face charges in the United States.

Earlier in the day, China vowed to "spare no effort" to protect against "any bullying that infringes the legitimate rights and interests of Chinese citizens."

Chinese Foreign Minister Wang Yi didn't mention Meng by name. But ministry spokesman Lu Kang said Wang was referring to cases of all Chinese abroad, including Meng's.

Washington accuses Huawei of using a Hong Kong shell company to sell equipment to Iran in violation of U.S. sanctions. It says Meng and Huawei misled banks about the company's business dealings in Iran.

Huawei, the biggest global supplier of network gear for phone and internet companies, is the target of U.S. security concerns. Washington has pressured other countries to limit use of its technology, warning they could be opening themselves up to surveillance and theft of information.

The U.S. and China have tried to keep Meng's case separate from their wider trade dispute and suggested Tuesday that talks to resolve their differences may resume.

The Chinese government said that its economy czar had discussed plans with U.S. Treasury Secretary Steven Mnuchin and Trade Rep. Robert Lighthizer for talks aimed at settling the two countries' differences. Lighthizer's office confirmed that he had spoken by phone with Chinese Vice Premier Liu He.

The news that trade negotiations may resume lifted stock markets around the world.

The United States has slapped tariffs on $250 billion in Chinese imports in response to complaints Beijing steals American technology and forces U.S. companies to turn over trade secrets.

Tariffs on $200 billion of those imports were scheduled to rise from 10 per cent to 25 per cent on Jan. 1. But Trump agreed to postpone those by 90 days while the two sides negotiate.

------ Gillies reported from Toronto. Wiseman contributed from Washington. Associated Press Business Writer Joe McDonald, AP researcher Yu Bing and APTN video producers Fu Ting and Olivia Zhang in Beijing contributed to this report.