A Canadian judge has granted bail to a top Chinese executive facing possible extradition to the US in a case that has led to the apparent detention of a former Canadian diplomat in Beijing and complicated high-stakes US-China trade talks.

Justice William Ehrcke announced his decision to grant Meng Wanzhou bail on Tuesday after two and a half days of hearings.

Ms Meng is the chief financial officer of telecommunications giant Huawei and also the daughter of its founder.

China Huawei
Courtroom sketch of Meng Wanzhou (Jane Wolsak/AP)

She was detained at the request of the US during a stopover at the Vancouver airport on December 1, the same day that Presidents Donald Trump and Xi Jinping of China agreed to a 90-day ceasefire in a trade dispute that threatens to disrupt global commerce.

The US has accused Huawei of using a Hong Kong shell company to sell equipment in Iran in violation of US sanctions.

It also says that Ms Meng and Huawei misled banks about the company’s business dealings in Iran.

On Monday, China detained a former Canadian diplomat in Beijing in apparent retaliation.

Canada China-Huawei
Liu Xiaozong, right, husband of Meng Wanzhou, arrives to attend the hearing (Jonathan Hayward/AP)

Canadian public safety minister Ralph Goodale confirmed a former Canadian diplomat had been detained in Beijing.

“We’re deeply concerned,” said Mr 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 on Monday night during one of his regular visits to Beijing, according to a person familiar with the matter.

Mr Kovrig is now based in Hong Kong as North East Asia adviser for the International Crisis Group.

Canada had been bracing for retaliation for Ms Meng’s 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 Ms Meng’s detention.