Ottawa 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 the federal government 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.

Canada's 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 spokesperson 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.

Later the same day, Bains and Goodale told reporters that Huawei isn't the only company that can build 5G in Canada. When asked about options, Bains mentioned Ericsson as an example.

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

The development of 5G — or fifth-generation — mobile networks will give users much faster connections and provide powerful data capacity to meet heavy demand from new applications, such as virtual reality, as people connect more devices to the internet.

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.

Ottawa will also invest up to $35.7 million towards a $92.7-million partnership between Siemens Canada engineering company, and Atlantic Canada utilities Nova Scotia Power and New Brunswick Power. The deal calls for Siemens Canada to conduct research and development on smart-grid technology for power systems in the provinces.

The government's Siemens and Nokia commitments will be made through a federal program known as the strategic innovation fund.

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.