MONTGOMERY, Ala. — The U.S. Department of Justice on Thursday launched an investigation into conditions in Alabama prisons, a corrections system that has been troubled by overcrowding and rocked by recent outbreaks of violence.

The investigation by the Justice Department’s Civil Rights Division will focus on whether male inmates are housed in safe, secure and sanitary conditions and protected from physical harm and sexual abuse, the department indicated.

“The Constitution requires that prisons provide humane conditions of confinement,” Principal Deputy Assistant Attorney General Vanita Gupta said in a statement. “We hope to work cooperatively with the state of Alabama in conducting our inquiry and ensuring that the state’s facilities keep prisoners safe from harm.”

The probe is the latest difficulty for the Alabama corrections system, which has fully acknowledged challenges with crowding and staffing levels. Alabama agreed last year to make changes at its prisons for male inmates and at its only prison for women after the Justice Department launched a similar investigation there following complaints of sexual abuse of inmates by guards.

Gov. Robert Bentley, who this week attended the memorial service for a corrections officer who died after being stabbed, said he welcomed the investigation.

“We both share a common goal of wanting to improve the safety of the officers and inmates within the facilities,” Bentley said. The governor has pushed to build new prisons, and on Thursday called overcrowding a decades-old “issue that must be addressed.”

Corrections Commissioner Jeff Dunn said department officials “understand the seriousness of the DOJ investigation and will cooperate fully.”

Alabama prisons — with 23,692 inmates in facilities built for 13,318 — house nearly twice the number of inmates they were designed to hold. A corrections officer died last month after being stabbed by an inmate at William C. Holman Correctional Facility, a maximum security prison that houses the state’s execution chamber.

The same prison was also the site of two recent uprisings in which inmates stabbed the warden, seized control of a dormitory and set fires.

“We knew this was coming. No one should be surprised by this,” said state Sen. Cam Ward, chairman of a legislative prison oversight committee, said in a telephone interview.

The department’s Thursday letter to the state did not elaborate on what prompted the investigation. The director of a legal group that is representing inmates in a lawsuit over violence at St. Clair Correctional Facility praised the decision.

“In over 30 years of working in Alabama’s prisons, I have not seen the kind of pervasive violence, abuse and frustration that we are seeing today,” said Bryan Stevenson of the Equal Justice Initiative. The group also in 2014 asked the Justice Department to investigate what it called “unconstitutional” conditions in state prisons.

Stevenson said the state is seeing an “unprecedented number of murders, rapes, torture and abuse in state prisons.”

“Officers are not safe, prisoners are not safe and the public is not being well served,” he said.

Alabama lawmakers last year approved sweeping changes to sentencing and probation standards in an effort to relieve crowding. This year, lawmakers rejected Bentley’s proposal to consolidate existing facilities into three new mega-prisons for men — housing up to 4,000 inmates each — and one new prison for women.

“You are going to have to invest. The question is: Are you going to do it on your own or when a federal judge tells you to do it?” Ward said.