The federal government will announce up to $40 million for Finnish telecom giant Nokia on Thursday to conduct research on 5G wireless technology in Canada.

The funding comes as Ottawa is in the middle of a comprehensive national security review of the potential involvement of Nokia’s Chinese rival, Huawei, in Canada’s eventual fifth generation mobile network.

Ottawa is also locked in a diplomatic dispute with Beijing following Canada’s Dec. 1 arrest of Huawei executive Meng Wanzhou at the request of the United States.

Huawei, Nokia and Sweden’s Ericsson are among the top contenders to help Canada’s telecom companies, including BCE and Telus, build the country’s 5G mobile networks.

Three of Canada’s partners in the Five Eyes intelligence-sharing group — the United States, Australia and New Zealand — have banned the use of Huawei products in 5G network development based on fears the company could spy on behalf of China.

Federal Innovation Minister Navdeep Bains, who along with Public Safety Minister Ralph Goodale is responsible for overseeing the 5G security review, has said the analysis is not just about Huawei and is designed to assess how best to protect Canadians.

Bains finalized the Nokia deal Thursday in Davos, Switzerland, where he’s participating in the World Economic Forum.

Canada’s ongoing scrutiny of Huawei has created concerns within the Chinese government. Lu Shaye, China’s envoy to Ottawa, warned Canada last week of possible repercussions if the government ultimately decides to bar Huawei from building the country’s 5G networks.

A Chinese foreign-ministry spokeswoman later tried to play down Lu’s remarks, by saying the ambassador didn’t mean that China intended to interfere in Ottawa’s decision-making process. Hua Chunying also told journalists in Beijing on Monday that losses would be inevitable since Huawei is a leading supplier of 5G technology, according to a transcript on the foreign ministry’s website.

Few details are available about Canada’s 5G security review but a well-placed source has said a decision is still months away.

The federal funding will back Nokia’s research work in Canada to help telecom networks meet the needs of 5G technology. The company is also developing cybersecurity tools to protect telecom networks.

The government is expected to sell the deal as a way to support more than 2,000 of Nokia’s jobs already in Canada and to create 237 new positions. Nokia Canada’s projects, valued at over $214 million, are based in Mississauga, Ont., and the Ottawa suburb of Kanata.

The issue of whether Huawei is allowed to build the country’s 5G networks has connections to a diplomatic crisis over Canada’s recent arrest of Meng, the company’s chief financial officer and daughter of its founder.

Canadian police arrested Meng at Vancouver’s airport at the request of American authorities, who are seeking her extradition on fraud allegations.

Her arrest has angered Beijing and the case is at the heart of tensions between Canada and China. The Chinese government says Meng has done nothing wrong and has demanded her release, warning Canada of severe consequences if it doesn’t free her.

After her arrest, China detained two Canadians. Michael Kovrig, a Canadian diplomat on leave, and Michael Spavor, an entrepreneur, were taken in on allegations of engaging in activities that have endangered China’s national security.

In recent weeks, China also sentenced another Canadian, Robert Lloyd Schellenberg, to death in a sudden retrial of his drug-smuggling case. He was originally handed a 15-year jail term in 2016, but the court gave him the death penalty after revisiting his case.