A federal judge has rejected a media request to interview former Guantanamo Bay inmate and child soldier Omar Khadr.

On Thursday, Judge Richard Mosley agreed with the warden of the Alberta prison where Khadr is being held that a face-to-face interview would pose a threat to the safety of Khadr, the staff and other inmates.

Mosley dismissed the judicial challenge brought by the Star, the CBC and White Pine Pictures, which argued that denying the interview is a breach of the constitutional guarantee of the public’s right to know.

“A penitentiary is not a place where the public has an expectation of exercising its right to freedom of expression,” Mosley wrote, confirming that Nancy Shore, acting warden of the Bowden Institution, was reasonable in rejecting the interview request.

Khadr, who was captured in Afghanistan in 2002 when he was 15 years old, was held at Guantanamo Bay until he was transferred to Canada in 2012. In 2010, he pleaded guilty before an American military commission to throwing a grenade that killed a U.S. soldier and was given an eight-year sentence. Once in Canada, he said he only confessed and agreed to a Pentagon plea deal to get out of U.S. custody. He is applying for bail next month and will have a parole hearing this summer.

He was transferred from Guantanamo to Canada in 2012 and has said that he only confessed to the crimes to get out of American custody. He is applying for bail next month and will have a parole hearing this summer.

Last March, Toronto Star reporter Michelle Shephard requested an on-camera interview with Khadr at Bowden that would appear in the Star and in a CBC documentary Shephard is co-directing with filmmaker Patrick Reed.

Shore rejected the request, writing that an interview would endanger the prison where he is being held, inflame the inmate population and “cause security/safety incidents.”

Judge Mosley ruled that while “the media may legitimately expect constitutional protection for free expression in a penitentiary … this right must be balanced against the need to protect the security of the institution and the safety of persons, including the staff, the prison population and any particular inmate.”

The Star’s editor-in-chief, Michael Cooke, said the decision will prevent the public from getting to know Khadr before he is set free.

“Omar Khadr has a right to be interviewed by a reporter before his release. It has been 12 years of government interference — first in Guantanamo Bay, and now here in Canada. Corrections Canada’s reason that it would require unprecedented security measures, including an entire lockdown of the facility, just for an interview to take place seems ludicrous. We’re disappointed the courts could not help,” Cooke said.

John Phillips, the lawyer who represented the Star and the other media, said he was disappointed with the ruling.

“It’s obvious that Justice Mosely felt his hands were tied by previous court rulings that limit a judge’s ability to overrule the decision of a prison official,” he said.