OTTAWA (Reuters) - 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.

Slideshow ( 2 images )

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.

Khadr later recanted and his lawyers said he had been grossly mistreated. In 2010, the Canadian Supreme Court ruled that Canada breached his rights by sending intelligence agents to interrogate him and sharing the results with the United States.

The case proved divisive: defenders called Khadr a child soldier while the then-Conservative government dismissed calls to seek leniency, noting he had pleaded guilty to a serious crime.

“Meet Canada’s newest multi-millionaire – Omar Khadr,” said the Conservatives as they unveiled a protest petition.

Tony Clement, the Conservative Party’s public safety spokesman, said “it is one thing to acknowledge alleged mistreatment, but it is wrong to lavishly reward a convicted terrorist who murdered an allied soldier who had a wife and two children”.

Khadr spent a decade in Guantanamo before being returned to Canada in 2012 to serve the rest of his sentence. He was released on bail in 2015 and lives in Edmonton, Alberta.

The Canadian government and Khadr’s lawyers agreed on the compensation deal, said the sources, who asked to remain anonymous given the sensitivity. Canada has reached a series of expensive settlements with citizens imprisoned abroad who alleged Ottawa was complicit in their mistreatment.

Khadr, 30, had sued Ottawa for C$20 million on grounds of violating his human rights. News of the settlement was broken by the Globe and Mail newspaper.

A spokesman for Public Safety Minister Ralph Goodale declined to comment. Khadr’s lawyers did not respond to a request for comment. The U.S. Embassy was closed for the July Fourth holiday.

Khadr was taken to Afghanistan by his father, an al Qaeda member, who apprenticed the boy to a group of bomb makers. The father died in a battle with Pakistani forces in 2003.

“It is the right decision in light of the callous and unlawful treatment meted out to Mr. Khadr with the complicity of Canadian officials,” said Ihsaan Gardee, executive director of the National Council of Canadian Muslims.

($1 = 1.2936 Canadian dollars)