OTTAWA -- Justin Trudeau says he shares the concerns of Canadians who object to reports of the government's multi-million dollar settlement with Omar Khadr.

But the prime minister says if the government hadn't settled with the former Guantanamo Bay inmate, it would have cost the government as much as $30- to $40 million to put an end to the case.

"I can understand Canadians' concerns about the settlement. In fact, I share those concerns about the money. That's why we settled," Trudeau said Thursday.

Khadr filed a $20-million lawsuit against the government for violating his Charter rights, and has received an out-of-court settlement reportedly worth $10.5 million.

Khadr was sent to the notorious U.S. prison after being captured during a firefight with U.S. forces in Afghanistan in 2002. He was 15 years old when he was wounded in a battle in which U.S. Sgt. Chris Speer was killed and fellow Delta Force soldier Layne Morris was blinded in one eye.

Khadr, now 30, pleaded guilty to five war crimes before a widely condemned military commission at Guantanamo Bay in 2010. He said he agreed to the plea so he could get out of the American prison and return to Canada. He was released on bail in 2015 pending his appeal of the war-crimes conviction.

Khadr was interrogated in 2003 and 2004 by Canadian intelligence officials. Khadr says his jailers threatened him with rape and kept him in isolation, and once used him as a human mop to wipe up urine.

In 2010, the Supreme Court of Canada ruled that those Canadian officials violated Khadr's rights under the Charter of Rights and Freedoms during their interrogations. It found they were participating in the "then-illegal military regime" at Guantanamo.

The government payout has angered rank-and-file Canadians, as well as veterans groups, and has exposed the Liberals to scathing political attacks from the opposition Conservatives.

"If we had continued to fight this, not only would we have inevitably lost, but estimates range from $30- to $40-million that it would have ended up costing the government," Trudeau said.

"This was the responsible path to take."

Trudeau said the lesson for future governments is that when they violate a Canadian's rights, everyone pays.

"The measure of a society -- a just society -- is not whether we stand up for people's rights when it's easy or popular to do so. It's whether we recognize rights when it's difficult, when it's unpopular."