The Canadian government is set to apologize, and give $10.5 million, to Omar Khadr — a Canadian who spent 10 years at the U.S. military prison in Guantanamo Bay.

The deal, revealed to The Canadian Press by an unnamed government official, was reportedly negotiated by Khadr’s lawyers last month.

Toronto-based lawyer, Warda Shazadi Meighen, who is not involved in the case, offered a deeper look into the government’s decision.

Walmart Canada is getting rid of price-matching program

Walmart Canada is getting rid of price-matching program

Coverage of Omar Khadr on Globalnews.ca

Omar Khadr’s lawyers says it’s time for Canada to pay up and say sorry

Omar Khadr’s lawyers says it’s time for Canada to pay up and say sorry

Omar Khadr to receive apology and $10.5M from Canada

Omar Khadr to receive apology and $10.5M from Canada

Why is the Canadian government apologizing?

“The rule of law was violated,” Meighen told Global News, explaining that Khadr wasn’t given a fair trial.

The compensation and apology come after 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.

“Canada has a history of recognizing and apologizing when it has made mistakes,” she added. “This settlement is a recognition of the fact that we have standards in Canada.”

She explained that because Khadr is a Canadian citizen, the country had a “higher threshold” of responsibilities, as opposed to the United States. The settlement is also in response to Khadr suing the Canadian government.

READ MORE: A chronological look at Omar Khadr’s long legal odyssey

Is the years-long legal battle now over?

On Tuesday, Prime Minister Justin Trudeau indicated that the settlement means the lengthy legal battle is coming to an end.

“There is a judicial process underway that has been underway for a number of years now,” Trudeau said in Dublin, Ireland.

“We are anticipating, like I think a number of people are, that that judicial process is coming to its conclusion.”

While Meighen doesn’t have access to the case, she says the deal likely means it’s coming to an end.

“Typically, the lawsuit becomes moot,” once a settlement or compensation is reached, she explained.

WATCH: Getting to know Omar Khadr

How common is it for the government to compensate in legal cases?

While the government has apologized in several cases, Meighen says she’s only aware of one other Canadian receiving a compensation as large as Khadr’s.

Former prime minister Stephen Harper apologized in 2007 to Maher Arar, a Canadian who was tortured in Syria on terror suspicions in 2002.

A judicial inquiry later found that Arar had no connection to terrorist groups and the RCMP had provided misleading information to U.S. authorities who deported him to Syria. Arar was given $11.5 million.

Meighen says she hopes such compensations don’t become more common.

“Not necessarily because that’s not the right thing to do,” she said, but because she hopes Canadians aren’t ill-treated again.

Disagreement over the issue

The government’s decision attracted some opposition, especially from the Conservative Party.

MP Michelle Rempel said Khadr was a “convicted terrorist.”

2/ Despite this, the current government is willing to provide $10 million to a convicted terrorist. — Michelle Rempel Garner (@MichelleRempel) July 4, 2017

Meighen described Rempel’s take as an “unfortunate spin” on the case.

Khadr was a teenager at the time he was captured in Afghanistan for throwing a grenade that killed a U.S. soldier, which led to many international organizations dubbing him a child soldier. He was the youngest and last Western detainee held at the notorious prison.

Tuesday’s news of the government’s compensation was praised by advocacy organizations.

Amnesty International welcomed word of the settlement, calling it long overdue. The statement was echoed by the National Council of Canadian Muslims (NCCM).

READ MORE: Omar Khadr’s criminal record in Canada shows ‘absolute ignorance’: lawyer

“It is the right decision in light of the callous and unlawful treatment meted out to Mr. Khadr with the complicity of Canadian officials,” NCCM’s executive director Ihsaan Gardee said in a news release Tuesday.

“Mr. Khadr’s ordeal reminds us that every Canadian has the right to be treated fairly and in accordance with the principles of fundamental justice and the rule of law.”

—With files from the Associated Press, the Canadian Press