A judge in Thunder Bay, Ont., has ruled a Lac Seul First Nation man who was held in solitary confinement for more than four years will not stand trial for first-degree murder in the 2012 death of another inmate at the Thunder Bay Correctional Centre.

Adam Capay, who is in his mid-20s, left the courthouse with family members Monday afternoon after Ontario Superior Court Justice John Fregeau ruled that Capay's rights under the Canadian Charter of Rights and Freedoms had been violated.

Fregeau ruled that staying the murder charge, which effectively ends the prosecution of Capay, was to remedy breaches of his charter rights under Sections 7, 9, 12 and 15. Those include:

The right of life, liberty and security of person (Sec. 7).

The right not to be arbitrarily detained (Sec. 9).

The right not to be subjected to cruel and unusual punishment (Sec. 12).

The right to be equal before and under the law (Sec. 15).

A publication ban remains in effect on the reasons for the judge's decision and all evidence presented. That ban is scheduled to be lifted on Feb. 27, when the window to appeal the decision closes.

The Ministry of the Attorney General confirmed the Crown is reviewing Fregeau's decision but did not comment on whether it would appeal.

Capay was charged with first-degree murder in the death of Sherman Quisses, 35, in June 2012. At the time, both men were behind bars.

Capay made national headlines in 2016, after Ontario Human Rights chief commissioner Renu Mandhane toured the Thunder Bay District Jail in early October of that year. Mandhane reported that Capay had been held in solitary confinement in a windowless room for more than four years, spending 24 hours a day in artificial light.

"The UN standards would say that anything above 15 days has shown to have a negative psychological impact on an individual, and that it may constitute cruel and inhumane treatment, or even torture," Mandhane told CBC News at the time. With this case, "we're talking about a hundred times that limit."

At the time, Capay was in jail on remand, awaiting trial.