A former Guantanamo Bay prisoner who killed a U.S. soldier will receive millions of dollars and an apology from the Canadian government, officials announced Tuesday.

Omar Khadr will receive $10.5 million Canadian ($8 million American) after the government struck a deal with Khadr’s lawyers in June, the Associated Press reported.

Khadr pleaded guilty in 2010 to murdering American special forces medic U.S. Army Sgt. First Class Christopher Speer.

U.S. troops captured Khadr when he was 15 after they suspected that he threw a grenade at Speer during a firefight at a compound suspected to be under al-Qaeda’s control.

Khadr was sent to Guantanamo Bay military prison in Cuba, where a military commission charged him with war crimes.

After Khadr pleaded guilty, a judge sentenced him to eight years in addition to time already spent behind bars. The Obama administration quietly shipped Khadr from Guantanamo to Canada in 2012 so he could serve out the rest of his sentence in his home country.

The Canadian government granted Khadr bail in May 2015 after a judge rejected the Canadian government’s request to block Khadr’s release while he appeals his conviction.

Khadr appealed the conviction because he claimed he was coerced into making a guilty plea.

A Canadian Supreme Court ruling in 2010 said Canadian intelligence interrogated Khadr at Guantanamo Bay in 2003 under “oppressive circumstances,” using tactics such as sleep deprivation to get information out of him, and then shared the information with U.S officials.

Khadr’s lawyers filed a $20 million lawsuit against the Canadian government for wrongful imprisonment, arguing that the government did not protect its own citizen and worked with the U.S. to abuse Khadr in violation of international law.

His lawyers also argue that Khadr’s father, Ahmed Said Khadr, forced Omar Khadr into war because his family briefly stayed with Osama bin Laden when he was a young boy.

Upon his release from prison in 2015, Khadr asked Canada for “a fresh start” to continue his education, with the goal of working in health care after he apologized to the families of the victims.