Gov. Martin O’Malley talks to reporters about the indictment of 25 people, including 13 female correctional officers, in a federal case involving jail contraband at the Baltimore City Detention Center. (Brian Witte/AP)

As a young city prosecutor, then a council member, then mayor and then governor, Martin O’Malley has had to contend with the crowded, mismanaged and ultimately corrupt Baltimore City Detention Center.

On Thursday, the Maryland General Assembly will begin probing what federal authorities say has been a years-long failure of leadership under the Maryland governor.

O’Malley (D) ran for governor on the promise that he would improve conditions in the Maryland prison system. Over more than six years as Maryland’s top elected official — a post he won in part with a crime-fighting reputation — he amassed a flurry of statistics, such as falling rates of violence behind bars.

But according to a federal indictment unsealed this spring, O’Malley’s statistics of progress masked a broken state disciplinary system that allowed more than a dozen female corrections officers to go to work for a violent prison gang with little or no fear of reprisal.

The corrections officers smuggled drugs, cellphones and money into the jail, according to prosecutors, and four of them even had children with a single incarcerated gang member. The largest state-run jail served not as a place of punishment, prosecutors said, but as a haven for members of the Black Guerrilla Family. And from inside the decrepit, 200-year-old jail, the gang amassed cash and cachet that allowed it to spread onto the streets of Baltimore.

More Post coverage of the Maryland jail scandal.

Aides said O’Malley does not plan to attend Thursday’s hearing. But lawmakers’ questioning of Gary D. Maynard, his corrections secretary, could shed light on how much O’Malley knew about the jail’s most recent troubles, and when.

O’Malley announced late Wednesday several significant changes to jail security and the way prison investigations are handled.

The state will increase the size of its internal investigations unit by 50 percent, adding eight sworn detectives and four intelligence technicians. The unit is responsible for investigating all crimes by inmates, as well as allegations of corruption among staff members. The Washington Post reported last month that the number of investigators in the unit had remained virtually unchanged since 2006, with fewer than one person per correctional facility, despite a caseload that doubled in that time.

The governor also announced that he wants to require polygraph tests of all future correctional officer applicants. The Post reported that neither correctional officers nor investigators have to undergo polygraphs, a standard requirement for other Maryland law enforcement jobs. The legislature authorized O’Malley to begin such polygraphs three years ago, but he hasn’t.

O’Malley also said he would explore the feasibility of requiring correctional officers to pass through a full body scan machine before entering state correctional facilities to prevent incoming contraband.

“Like all Marylanders, I am outraged by the criminal wrongdoing at the Baltimore City Detention Center,” O’Malley said. “We understand there is more work to do — and we are working ever day — to build the public’s confidence in our prison system.”

In his announcement, O’Malley continued to cast the federal indictments as a collaboration with the state. But his aides have been vague when asked when the governor first learned of the federal investigation, or whether he knew of the pending indictments before he left on a trade mission to Israel in April. In private meetings with lawmakers, O’Malley has suggested that he would not have left if he had known, according to legislative aides.

The governor’s staff members also have not answered questions about whether Maynard sought additional funding or other resources to combat the influence of prison gangs or investigate corrupt officers, especially after a previous federal indictment in 2009 suggested widespread collusion between officers and Black Guerrilla Family members.

O’Malley’s team is also likely to face tough questions about a statewide Correctional Officers’ Bill of Rights, which he signed but has, since the indictments, promised to revisit. The document, which granted new rights to guards accused of misconduct, has made it more difficult to remove problem officers, according to federal investigators.

For O’Malley, the origins of the current jail scandal began in the first days of his tenure in 2007. Although his office had just been handed a report listing 300 gang members inside the Baltimore jail, a more pressing corrections problem took the focus and resources of his fledgling administration.

While O’Malley ran for governor, two correctional officers were killed in Maryland prisons for the first time in more than 20 years. And within two months of O’Malley’s move into the governor’s mansion, another officer was stabbed at the state’s notoriously violent House of Corrections in Jessup.

While interviewing Maynard, a respected head of prisons from Oklahoma, O’Malley stressed that violence was his top concern, Maynard said in an interview with The Post last month.

Maynard took on the issue with force, deciding secretly to close the House of Corrections in less than 30 days. Out of concern that the closure would spark a riot, Maynard informed only a handful of aides of the plan and moved many of the jail’s 850 inmates under the cover of night. His quick work won him admirers among O’Malley aides as well as with lawmakers in the General Assembly.

As the governor’s first term progressed, however, a federal indictment that alleged widespread gang activity at another nearby state prison, the Maryland Correctional Institution, hinted of systemic corruption among Maryland guards.

Federal prosecutors said BGF had recruited prison employees who used hidden compartments in shoes to smuggle heroin, ecstasy, tobacco, cellphones and other contraband into the Jessup facility. One inmate was able to order Grey Goose vodka and salmon delivered to his cell by employees.

Wiretapped conversations recorded in that 2009 case suggested the problem was even more widespread at the Baltimore City Detention Center.

The state, however, was beginning to feel the full effect of the economic downturn, facing one of several consecutive shortfalls in excess of $1 billion.

Preparing for a reelection fight, O’Malley also needed to maintain a clear narrative on his funding priorities and allotted all the extra money he could muster to continue increasing spending on education.

The governor did offer one solution to prison corruption, though — seizing on the idea of cellphone jamming in state correctional facilities as a cheap but potentially powerful tool to limit the influence of gangs.

O’Malley petitioned for federal approval, but regulators rebuffed his request, saying it could sever 911 services for the public near state jails and prisons. O’Malley wrote to Attorney General Eric H. Holder Jr., and then to federal prison officials, finally securing a test at a facility in western Maryland. He staged a news conference and made a cellphone call in front of cameras while standing outside the prison to prove it was safe.

But federal approval remained a long shot, and regulatory testing to be sure prison officials’ phones functioned inside jails would take years, ultimately finishing up only in recent months.

Meanwhile, the resources for everyday policing of the system barely budged. In a meeting in his office in 2009, Maynard turned to the FBI for help, officials with knowledge of the investigation said. He offered all the resources he could spare: two full-time investigators. They joined a task force to begin listening to inmates’ phone calls and piecing together tips left from the 2009 case.

Despite Thursday’s hearing, it remains uncertain whether the General Assembly will hold a fellow Democrat accountable for the current scandal or explore whether corruption extends to other facilities.

Democratic legislative leaders have tried to deflect criticism from O’Malley, saying the state has failed to fix the jail for decades. House Speaker Michael E. Busch (D-Anne Arundel) said shortly after the indictment that every branch of state government should share the blame.

Busch and Senate President Thomas V. Mike Miller Jr. (D-Calvert) even announced the conclusion of Thursday’s hearing before it begins. In a joint statement last month, they said it would end with the formation of a commission to study the state’s prison system. That group will hold additional meetings over the year, they said, and the legislature will go about fixing issues when lawmakers reconvene next year.

Maryland Republicans have charged that such pronouncements make Thursday’s hearing little more than a charade to protect O’Malley, who is contemplating a White House bid. Republicans have also called for an independent audit of the state’s correctional system.

Annys Shin contributed to this report.