A former civilian member of Canada's national police force has been sentenced to 14 years in prison for leaking intelligence to suspected criminals.
Prosecutors argued that Cameron Ortis, 51, shared government secrets with organised crime figures.
Ortis has denied this, and said he was working secretly to prevent "a grave threat to Canada".
He was convicted in November at an Ottawa court after an eight-week trial.
Judge Robert Maranger said on Wednesday the sentence takes into account time Ortis has already spent behind bars, and he will ultimately serve seven more years.
The case marked the first time that Canada's current espionage laws were tested in a trial.
Prosecutor Judy Kliewer criticised the sentence as insufficient and filed a notice of appeal against it.
"Ortis really placed the security of Canadians in jeopardy," she told reporters outside the courthouse on Wednesday.
"Obviously we thought this conduct was deserving of a much higher sentence than what the judge imposed today."
Ms Kliewer had sought a 28-year prison sentence for Ortis, saying a lenient sentence would send a message to Canada's allies, including the US and the UK, that the country is unable to protect sensitive information.
But his lawyers argued for a shorter sentence of seven years, as Ortis had already spent three years behind bars while awaiting trial.
Defence lawyer Jon Doody said his client "lost everything" during that time, including his job, friends and savings.
Judge Maranger said the 14-year sentence is a "fit and just" amount of time.
He said it takes into account his crimes as well as the "punitive" conditions Ortis endured in prison, part of which was in isolation during the Covid-19 pandemic.
Ortis was arrested in 2019 and charged with six counts, including violating national security laws. He was found guilty on all charges.
At the time of his arrest, he served as the director general of the National Intelligence Coordination Centre - a branch of the Royal Canadian Mounted Police (RCMP) described as a "clearing house" for internal intelligence and sensitive information.
He had gained a high-level security clearance since beginning work for RCMP in 2007 as a civilian member of the force.
Prosecutors said Ortis used his role to leak sensitive information in 2015 to three members of an international money-laundering ring and a man named Vincent Ramos.
US authorities previously connected the mobile security company that Ramos ran to drug traffickers and members of organised crime.
Ortis asked Ramos for nearly C$27,500 ($20,500; £16,000) in exchange for sharing information on police operations, prosecutors said, though there is no evidence he ever received payments.
In his testimony before the court, Ortis said he leaked the intelligence as part of a secret mission he had launched to lure targets into adopting an encrypted email service, which would then give security agencies access to their communication.
His lawyers said his actions were "to confront a grave threat to Canada that could not be ignored."
Prosecutors, however, argued that he deliberately shared the information without approval of his superiors. They added there was no record in RCMP archives of his mission.
"His story was nothing but an attempt to have you believe that his criminal, self-motivated acts were aimed at some lofty and secret purpose," Ms Kliewer, the prosecutor, told the court.