The Canadian government will apologize to former Guantanamo Bay inmate Omar Khadr and pay him around $8m (Canadian $10m) to compensate him for the abuse he suffered in detention, two sources familiar with the matter said on Tuesday.

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

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

Omar Khadr pictured in front of his lawyer's home in Edmonton, Alberta in 2015

Omar Khadr is photographed in an interrogation room in 2003 when he was 15 (left). Pictured in an undated handout photo (right)

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 reached 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 had sued Ottawa for around $15m (Canadian $20) on grounds of violating his human rights. News of the settlement was first reported by the Globe and Mail newspaper.

Khadr was taken to Afghanistan by his father, a senior al Qaeda member, who apprenticed the boy to a group of bomb makers who opened fire when U.S. troops went to their compound. The father was killed in a battle with Pakistani forces in 2003.

Omar Khadr, left, leaves court with his long time lawyer Nate Whitling (right) after a judge ruled to relax bail conditions in Edmonton in 2015

Prime Minister Justin Trudeau, in Ireland for a visit, said the judicial process should be ending soon but declined further comment.

Spokespeople for Trudeau and Justice Minister Jody Wilson-Raybould did not immediately respond to requests for comment. Nor did Khadr's lawyers. The U.S. Embassy was closed for the July 4 U.S. holiday.

'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.