TORONTO — A decision by the Canadian government to apologize and give millions of dollars to a former Guantanamo Bay prisoner who pleaded guilty to killing a U.S. soldier in Afghanistan came under mounting criticism Tuesday.

An official familiar with the deal said Tuesday that Omar Khadr will receive 10.5 million Canadian dollars ($8 million U.S.). The official was not authorized to discuss the deal publicly before the announcement and spoke on condition of anonymity. The government and Khadr’s lawyers negotiated the deal last month.

The Canadian-born Khadr was 15 when he was captured by U.S. troops after a firefight at a suspected al-Qaida compound in Afghanistan that resulted in the death of an American special forces medic, U.S. Army Sgt. First Class Christopher Speer. Khadr, who was suspected of throwing the grenade that killed Speer, was taken to the U.S. military prison in Guantanamo Bay, Cuba, and ultimately charged with war crimes by a military commission.

He pleaded guilty in 2010 to charges that included murder and was sentenced to eight years plus the time he had already spent in custody. He returned to Canada two years later to serve the remainder of his sentence and was released in May 2015 pending an appeal of his guilty plea, which he said was made under duress.

News of the government paying millions to someone who pleaded guilty to killing a U.S. soldier has upset conservatives in Canada.

“Odious. Confessed terrorist who assembled & planted the same kind of IEDs (improvised explosive devices) that killed 97 Canadians to be given $10 million,” former Conservative Minister Jason Kenney tweeted. “Khadr confessed to murdering Christopher Speer, a medic who rushed to his aid.”

Kenney said Khadr should be in prison paying for his crimes, not profiting from them at the expense of Canadian taxpayers.

Conservative party Parliament member Tony Clement said “most Canadians know this is absolutely wrong” and urged Khadr to give any settlement money to Speer’s widow and children. The Canadian Taxpayers Federation started an online petition aimed at Prime Minister Justin Trudeau, deploring the deal.

But Former Liberal leader Bob Rae tweeted that compensation was “long overdue.”

Omar Khadr spent 10 years at Guantanamo Bay. His case received international attention after some dubbed him a child soldier.

The Supreme Court of Canada ruled in 2010 that Canadian intelligence officials obtained evidence from Khadr under “oppressive circumstances,” such as sleep deprivation, during interrogations at Guantanamo Bay in 2003, and then shared that evidence with U.S. officials.

Khadr’s lawyers filed a $20 million wrongful imprisonment lawsuit, arguing that the Canadian government violated international law by not protecting its own citizen and that it conspired with the U.S. in its abuse of Khadr.

In Ireland on Tuesday, Trudeau declined to confirm the apology and payment. “There is a judicial process underway … and we are anticipating … that that judicial process is coming to its conclusion,” Trudeau said.

Scott Bardsley, a spokesman for Canada’s public safety minister, said in an email that settlement processes are confidential and “accordingly, the government is not in a position to provide any comment.”

The widow of Speer and another American soldier blinded by the grenade in Afghanistan filed a wrongful death and injury lawsuit against Khadr in 2014, fearing Khadr might get his hands on money from his $20 million wrongful imprisonment lawsuit. A U.S. judge granted $134.2 million in damages in 2015, but the plaintiffs acknowledged then that there was little chance they would collect any of the money from Khadr because he lives in Canada.

Khadr’s lawyers have long said he was pushed into war by his father, Ahmed Said Khadr, whose family briefly stayed with terrorist leader Osama bin Laden when Omar Khadr was a boy. Khadr’s Egyptian-born father was killed in 2003 when a Pakistani military helicopter shelled the house where he was staying with senior al-Qaida operatives.

After his 2015 release from prison in Alberta, Omar Khadr apologized to the families of the victims. He said he rejects violent jihad and wants a fresh start to finish his education and work in health care. He currently lives in Edmonton, Alberta.