President Donald Trump has said he would consider intervening in the case against Huawei executive Meng Wanzhou if it would be in the interest of US national security and help forge a trade deal with China.

Mr Trump told Reuters in an interview at the White House that if he thinks it would be good for what will “certainly be the largest trade deal ever made” he would intervene if necessary.

A Canadian court granted bail on Tuesday to Ms Meng, who was arrested at the United States’ request in a case that has set off a diplomatic furore among the three countries and complicated high-stakes US-China trade talks.

Hours before the bail hearing in Vancouver, China detained a former Canadian diplomat in Beijing in apparent retaliation for the December 1 arrest of Ms Meng, chief financial officer of Chinese telecommunications giant Huawei and daughter of the company’s founder.

After three days of hearings, a British Columbia justice granted bail of 10 million Canadian dollars (£6 million) to Ms Meng, but required her to wear an ankle bracelet, surrender her passports, stay in Vancouver and its suburbs and confine herself to one of her two Vancouver homes from 11pm to 6am.

Canada China Huawei
Courtroom sketch of Meng Wanzhou listening to the judge during a bail hearing in Vancouver (Jane Wolsak/The Canadian Press via AP)

The decision was met with applause in the packed courtroom, where members of Vancouver’s Chinese community had turned out to show support for Ms Meng.

She left the courthouse late on Tuesday surrounded by a security detail and was driven away in a black car without responding to questions from reporters.

Amid rising tension between China and Canada, Canadian Public Safety Minister Ralph Goodale confirmed earlier that a former Canadian diplomat had been detained in Beijing.

The detention came after China warned Canada of consequences for Ms Meng’s arrest.

“We’re deeply concerned,” Mr Goodale said.

“A Canadian is obviously in difficulty in China… We are sparing no effort to do everything we possibly can to look after his safety.”

Canada China-Huawei
Supporters hold signs outside the British Columbia Supreme Court in Vancouver (Darryl Dyck/The Canadian Press via AP)

Michael Kovrig, who previously worked as a diplomat in China and elsewhere, was taken into custody by the Beijing Bureau of Chinese State Security on Monday night during one of his regular visits to Beijing, said the International Crisis Group, for which Mr Kovrig works as North East Asia adviser.

Rob Malley, head of the Brussels-based non-governmental group, said Canadian consular officers had not been given access to Mr Kovrig.

He thinks Mr Kovrig was in Beijing on personal matters and was definitely not there for any reason that would undermine Chinese national security.

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.

“In China there is no coincidence,” Guy Saint-Jacques, a former Canadian ambassador to China, said of Mr Kovrig’s detention.

“Unfortunately Canada is caught in the middle of this dispute between the US and China. Because China cannot kick the US they turn to the next target.”

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 did not mention Ms Meng by name. But ministry spokesman Lu Kang said Mr Wang was referring to cases of all Chinese abroad, including Ms Meng’s.

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

On Tuesday, US State Department spokesman Robert Palladino told reporters in Washington “the charges against Meng pertain to alleged lies to United States financial institutions” about Huawei’s business dealings in Iran.

“It is clear from the filings that were unsealed in Canada, Meng and others are alleged to have put financial institutions at risk of criminal and civil liability in the United States by deceiving those institutions as to the nature and extent of Huawei’s business in Iran,” Mr Palladino said.

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

“We have every confidence that the Canadian and US legal systems will reach a just conclusion in the following proceedings,” Huawei said in a statement.

“As we have stressed all along, Huawei complies with all applicable laws and regulations in the countries and regions where we operate, including export control and sanction laws of the UN, US, and EU. We look forward to a timely resolution to this matter.”

The US and China have tried to keep Ms Meng’s case separate from their wider trade dispute and suggested on Tuesday that talks to resolve their differences may resume.

But Mr Trump undercut efforts to distinguish between trade talks and the Huawei case in his interview with Reuters.

Roland Paris, a former foreign policy adviser to Canadian prime minister Justin Trudeau, called Mr Trump’s comments troubling.

“Canada is acting in good faith, according to the law, in response to a US extradition request,” Mr Paris tweeted.

The Chinese government said its economy czar had discussed plans with US Treasury Secretary Steven Mnuchin and Trade Representative Robert Lighthizer for talks aimed at settling the two countries’ differences.

Mr Lighthizer’s office confirmed he had spoken by phone with Chinese vice premier Liu He.