OTTAWA -- The federal government is introducing legislation that would limit how long prison inmates can be kept in solitary confinement.

Once passed, the bill would -- for the first time -- impose a so-called legislative framework establishing a time limit for what prison officials call administrative segregation.

Administrative segregation is used when there is no reasonable alternative to maintain the safety and security of the institution, staff and inmates. It differs from disciplinary segregation, which is applied to inmates who are found guilty of a serious offence in custody.

The Correctional Service of Canada is also amending its policy to outlaw the practice in cases involving serious mental disorders or prisoners who are certified, those who are engaged in "self-injury" and those at risk of suicide.

"The new legislation that will follow will increase accountability, transparency and oversight around the use of administrative segregation," the government said in a release.

"This is an important step in ensuring that Canada's federal correctional system is effective, accountable and transparent, and that it helps inmates as they work towards rehabilitation and reintegration into society as law-abiding citizens."

Under the current law, the Correctional Service of Canada is required to release prisoners from administrative segregation at the earliest possible time.

The new law would establish a segregation time limit of 21 days initially, and then 15 days once the legislation has been the law of the land for 18 months.

The legislation also proposes amending the Corrections and Conditional Release Act and the Abolition of Early Parole Act to make them compliant with the Charter of Rights and Freedoms.

That includes reinstating an oral hearing after a suspension, termination or revocation of parole.

The legislation would also allow offenders convicted of an offence before March 28, 2011, and who meet the criteria for accelerated parole, to once again be eligible for an accelerated parole review.