The Canadian government is going to apologise and give millions to a former Guantanamo Bay prisoner who pleaded guilty to killing a US soldier in Afghanistan when he was 15, with Canada’s supreme court later ruling that officials had interrogated him under “oppressive circumstances”.

An official familiar with the deal said on Tuesday that Omar Khadr will receive 10.5 million Canadian dollars (US$8 million). The official was not authorised 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 US troops following a firefight at a suspected al-Qaida compound in Afghanistan that resulted in the death of an American special forces medic, US army Sgt Christopher Speer.

Khadr, who was suspected of throwing the grenade that killed Speer, was taken to Guantanamo 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.

Khadr spent 10 years in 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 US officials.

Khadr was the youngest and last Western detainee held at the US military prison in Guantanamo Bay, Cuba.

His lawyers filed a $20 million wrongful imprisonment lawsuit against the Canadian government, arguing the government violated international law by not protecting its own citizen and conspired with the US in its abuse of Khadr. A spokesman for the justice minister did not immediately respond to requests for comment.

The prime minister, Justin Trudeau, would not confirm any details while speaking to reporters in Ireland on Tuesday.

“There is a judicial process underway that has been underway for a number of years now, and we are anticipating, like I think a number of people are, that that judicial process is coming to its conclusion,” he said.

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 US 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 stayed with Osama bin Laden briefly 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 apologised 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 lives in Edmonton, Alberta.