MONTGOMERY, Ala. — The Alabama prison system on Thursday asked lawmakers for an additional $80 million over the next two years to boost staffing and comply with a federal court order to improve mental health care to inmates.

Corrections Commissioner Jeff Dunn told lawmakers during budget hearings that the system needs a $30 million supplement this year and a $50 million increase in 2019.

U.S. District Judge Myron Thompson last year ruled that Alabama’s psychiatric care of state inmates is “horrendously inadequate” and ordered the state to improve conditions. Dunn said the state must address the situation or risk federal intervention in the system and Thompson ordering the state what to do.

“We have a ruling from a federal judge that has been very critical of our system and basically said if the state does not address this issue, and address it immediately, then he is going to take other actions,” Dunn told reporters after the hearing. “I don’t think anybody in the state wants federal intervention.”

Most of the requested money would go to a new health care contract, but the state was also seeking $5 million to try to recruit and retain more officers in this fiscal year and $3.6 million to renovations at prisons needed to comply with the order.

For 2019, Dunn said $36 million is for the increased spending in the contract to provide health care to inmates. The other $14 million would go to try to raise the number of correctional officers in state prisons.

The prison chief said officer staffing is about half of what it should be, despite recruitment efforts. He said the system could need as many as 1,000 new corrections officers, although he acknowledged that $14 million would not provide that.

Southern Poverty Law Center attorney Maria Morris, who is representing inmates in the class-action lawsuit that led to the ruling, called the department’s request a “good start” but said she is concerned it will not be enough to improve conditions, particularly staffing levels. Thompson found a lack of staff was a significant contributor to the poor conditions.

“The lack of correctional staff is really dire. It’s frankly shocking,” Morris said.

Alabama inmates sued the state, saying the prison system was failing to provide constitutionally adequate medical and mental health care.

Jamie Wallace, an inmate diagnosed with bipolar disorder and schizophrenia, killed himself 10 days after testifying at the trial that he received sparse treatment despite hearing voices in his head that sometimes told him to kill himself. Wallace was in prison for killing his mother.