Court records for the case of a 19-year-old Canadian man who pleaded guilty to terrorism charges were unsealed after he asked a judge, in a handwritten letter, to allow him to hire the former counsel for Omar Khadr.

The note was among documents released last week that shed light on why the file on the alleged plot to detonate bombs in Times Square and the New York subway system and target concertgoers at various venues, in support of ISIS, was made public earlier this month.

Abdulrahman El Bahnasawy, who pleaded guilty to terrorism offences in 2016, bought bomb-making materials and helped secure a cabin within driving distance of the city for the purpose of building explosive devices, according to the unsealed court documents.

The records also reveal his lawyers said he had a "long and documented history of mental illness" and substance addiction.

In a hand-written letter dated Sept. 24. 2017, to U.S. District Judge Richard Berman for the Southern District of New York, El Bahnasawy asked the court to allow Dennis Edney, the Edmonton-based lawyer who represented former Guantanamo Bay prisoner Omar Khadr, to act on his behalf.

The letter suggests he had previously rejected the idea.

"My mom was crying and begging me and I feel too bad to be doing this to them. I also now think that granting these lawyers (Dennis and his team) permission to enter the case (by visiting me, talking in court and getting case files) would be of no harm but actually to my benefit," he wrote. "I also really don't want to see my parents in this horrible state so I please ask you to let Dennis [Edney] and his team enter the case (alongside the federal defenders.)"

Knowledge of case 'limited'

Edney could not immediately be reached for comment, and it is not clear what role he will have in the case.

A letter from New York lawyer Andrew Frisch to Berman, dated Oct. 2, 2017, said Edney is representing the parents and their son's interests, but that the lawyers' knowledge of the case is "limited."

"We do not know what specific crimes the defendant was charged with, or to what specific crimes he has pled guilty to nearly a year ago. We have not reviewed the case file, and lack critical information," it reads. "However, we are prepared to meet with the defendant, to review the case file, and to attend and observe proceedings in order to assess whether we may be able to help him as he has requested, and if he so chooses, to enter a notice of appearance."

The records were unsealed just days later, on Oct. 6.

The National Post has reported that Berman scheduled a meeting for Nov. 2 between the current lawyers, their possible replacements and Edney.

El Bahnasawy, who has been imprisoned at New York's Metropolitan Correctional Centre since last spring, is scheduled to be sentenced in December.

'Deteriorating' mental health

In a series of letters to the presiding judge, his lawyers pleaded for improved confinement conditions for the teen, noting multiple times that he "suffers from significant mental health issues" and arguing that he was "deteriorating" day by day.

Two others, Talha Haroon, a 19-year-old U.S. citizen living in Pakistan, and Russell Salic, a 37-year-old Philippine citizen, were also charged in connection with the alleged plot. The two were arrested outside of the U.S. and the hope, according to the documents, is that they will be extradited to the U.S. for prosecution.

The plan was exposed by an FBI agent, posing as an ISIS supporter, who communicated digitally with El Bahnasawy and two alleged co-conspirators in the months before the planned attacks, according to the documents.

Omar Khadr was given an apology and a $10.5-million settlement because his charter rights were violated in the U.S. military prison in Guantanamo Bay. (Colin Perkel/Canadian Press)

Earlier this year, the federal government formally apologized to Khadr and granted a reported settlement of $10.5 million.

In 2002, the then 15-year-old Khadr was captured by U.S. troops in Afghanistan after a firefight that resulted in the death of U.S. Sgt. Christopher Speer and injury of U.S. Sgt. Layne Morris.

Fought for Khadr release

In 2010, before a U.S. military commission in Guantanamo Bay, Cuba, Khadr admitted to throwing a grenade that killed Speer and blinded Morris in one eye.

He subsequently recanted that admission, arguing that he only made the confession because he had been tortured and wanted to return to Canada. He has appealed.

In 2010, the Supreme Court of Canada ruled that Canadian officials had failed to protect Khadr's rights under the Charter of Rights and Freedoms while he was detained in the U.S. military prison in Cuba.

Khadr returned to Canada in 2012 to serve out the rest of his sentence. In 2015, he was released on bail while he appeals his convictions in the United States, with strict bail conditions that included supervision by Edney.