Former Guantanamo Bay prisoner Omar Khadr has explained for the first time why he pleaded guilty to five war crimes, saying it was because he had been "left with a hopeless choice."

In a new court filing obtained by The Canadian Press, Khadr says he knew the Americans could have held him indefinitely even in the highly unlikely case that he was acquitted.

"I was left with a hopeless choice," Khadr, 27, says in the sworn affidavit.

"If I wanted the chance to eventually return to my home of Canada, I would have to be found guilty of crimes as determined by the U.S. government, which could then lead to me serving my sentence in Canada."

The affidavit, filed in Federal Court, comes as part of Khadr's $20-million lawsuit against the federal government for violation of his rights.

Without the plea agreement he signed in October 2010, Khadr says he would have faced the possibility of life-long detention and "continued abuse and torture" at Guantanamo Bay.

The entire agreement, he says, was put together by the American government.

Canadian intelligence

Khadr also makes it clear that — in contrast to the agreed stipulation of facts in the plea deal — he has never believed Jews or Americans should be killed or deserve to die and says he never willingly joined an al-Qaeda terrorist cell.

"Any participation in al-Qaeda-related activities was at the demand of the adults around me," his affidavit says.

He also says part of the American case against him was based on evidence supplied by Canadian intelligence officials, who interviewed him at the U.S. naval base.

The Americans detained Khadr as a terribly wounded 15-year-old following a four-hour firefight in Afghanistan in July 2002 in which a U.S. special forces soldier was killed.

Khadr says he has no memories of that battle or of the grenade that killed Sgt. Christopher Speer.

He also insists he had no plans to kill any soldiers, nor did he attack any of the U.S. forces who entered the compound after the battle was over.

Edmonton facility

Those denials, however, would have left him unable to enter the plea deal, which saw him given a further eight years behind bars.

He was transferred to Canada in September 2012 to serve out the rest of his sentence and is currently housed in an Edmonton maximum security facility.

The federal government has repeatedly denounced Khadr as an unrepentant terrorist.

Khadr is also appealing his underlying conviction in the U.S.