Canada is set to pay a former Guantanamo Bay inmate and killer of a U.S. soldier in Afghanistan almost $8 million as compensation for being mistreated by the government.

The Canadian Supreme Court ruled the government violated his rights while he was a prisoner in Guantanamo Bay.

Reuters reports:

Canada’s Liberal government will apologize to former Guantanamo Bay inmate Omar Khadr and pay him around C$10 million ($7.7 million) in compensation, two sources close to the matter said on Tuesday, prompting opposition protests.

A Canadian citizen, Khadr was captured in Afghanistan in 2002 at age 15 after a firefight with U.S. soldiers. He pleaded guilty to killing a U.S. Army medic and became the youngest inmate held at the military prison in Cuba.

A member of Canada’s Conservative Party blasted the decision saying the government was rewarding a terrorist.