TORONTO — The Canadian government has reached a settlement with one of two Canadians who were detained in China for nearly three years on national security charges.

John K. Phillips, a lawyer for Michael Spavor, confirmed Wednesday a settlement had been concluded.

''I am only able to say that the matter between Mr. Spavor and the government of Canada has been resolved, Phillips said.

The Canadian government has long maintained that Michael Spavor and Michael Kovrig were held to pressure Canada to release a senior executive of Chinese tech firm Huawei Technologies, who had been detained in December 2018 at the request of U.S. authorities who wanted her to face charges in America.

The Globe and Mail newspaper, citing an unidentified source, reported Wednesday that officials and Spavor reached a mediated settlement worth about $6 million Canadian (US$4.4 million) after he threatened to sue the government and his fellow prisoner. He alleged he was arrested because he had given information about North Korea to Kovrig, who worked for the Canadian Embassy in China and passed it on to his government.

The Canadian government's position remains unchanged that the charges against the two men were unfounded and their detentions were unjust.

''China's arbitrary detention of Michael Spavor and Michael Kovrig was unjust and unacceptable," Global Affairs Canada said in a statement Wednesday.

''While the 1019 days in which they were arbitrarily detained by China will never be erased, the Government of Canada is committed to supporting them in their efforts to turn to a new chapter in their lives based on their individual circumstances and impacts, and in acknowledgement of their ordeal and the suffering caused by their arbitrary detention by China. ''

The department declined to comment further, citing privacy considerations.

Both Spavor and Kovrig were arrested nine days after the Huawei arrest and released the same day in September 2021 that the Huawei executive, Meng Wanzhou, was allowed to return to China, ending her U.S. extradition case.

China has said that the two Canadians were suspected of crimes endangering national security. Spavor worked in China near the border with North Korea and had contact with North Korean officials, including leader Kim Jong Un.

Kovrig, who previously acknowledged to the Globe and Mail that he was in talks with Canada's government over compensation. didn't immediately respond to a message seeking comment.

Kovrig also told the Globe and Mail that he acted properly in his dealings with Spavor and followed the ''standard of laws, rules and regulations governing diplomats.''

Canada's intelligence watchdog published a report in December saying a program that has diplomats collect sensitive information abroad isn't adequately monitored and has at times caused Canada's allies to confuse diplomats with spies.

The program's officers are ''accredited and declared diplomats'' who since 2002 have collected information ''overtly, through networks of government and non-governmental contacts,'' according to the National Security and Intelligence Committee of Parliamentarians.

Canada does not have a covert spy agency operating abroad, such as the American CIA, but the information gathered by diplomats is often shared with Canada's spy agency, the Canadian Security Intelligence Service.