WASHINGTON (CBS/AP) — The Supreme Court has endorsed a court order requiring California to cut its prison population by thousands of inmates to improve health care for those who remain behind bars.

The court said in a 5-4 decision Monday that the reduction is “required by the Constitution” to correct longstanding violations of inmates’ rights.

Justice Anthony Kennedy, a California native, wrote the majority opinion, in which he included photos of severe overcrowding. The court’s four Democratic appointees joined with Kennedy.

Legal analyst Laurie Levinson of Loyola Law School told KNX 1070 the ruling may mean the state will have to free up to 46,000 inmates over the next two years to reduce the prison population down to constitutional levels.

(© Copyright 2011 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)