The Baltimore City Detention Center is the site where scores of crimes allegedly were committed by a prison gang and correctional officers. (Michael S. Williamson/The Washington Post)

Maryland’s top corrections official disclosed for the first time Thursday that the head of security at the embattled Baltimore City Detention Center failed a polygraph test aimed at weeding out corrupt members before she was fired.

Secretary of Corrections Gary D. Maynard made that revelation on a day when he testified before a panel of lawmakers in Annapolis and when other details came to light about the scandal involving a violent prison gang able to control the state-run jail.

An audit released Thursday detailed security breaches and unsanitary conditions in the Baltimore jail system, where the Black Guerilla Family gang allegedly colluded with 13 corrections officers to launder money and smuggle drugs and cellphones into the facility, according to a federal indictment unsealed in April.

Four guards had children with one incarcerated gang member, according to prosecutors, who are continuing to investigate what they have described as an out-of-control jail. During the hearing, Maynard said it is possible that additional corrections personnel will be held accountable.

Documents released under a public records request Thursday showed Gov. Martin O’Malley’s office was informed two years ago that guards were probably smuggling half of all contraband into state correctional facilities and were rarely facing criminal prosecution.

More Post coverage of the Maryland jail scandal.

E-mails also showed that O’Malley (D) was upset that he was abroad when the indictment was unsealed and unhappy about the “half-hammed” way the news was presented to the media.

Legislative leaders cast Thursday’s hearing as the first step in a months-long process to determine what steps they might take in next year’s legislative session to address shortcomings in Maryland’s jails and prisons.

“The good aspect of this situation is that the whole world is now aware of problems in the Maryland correctional system . . . and we are determined to fix those problems,” Senate President Thomas V. Mike Miller Jr. (D-Calvert) said at the outset of a joint hearing that he chaired with House Speaker Michael E. Busch (D-Anne Arundel).

The two leaders suggested that their primary aim was to understand what legislative and budgetary remedies might help address problems at the Baltimore jail and elsewhere. Suggestions floated Thursday included stiffening penalties for smuggled cellphones and removing the Baltimore jail from the governance of the corrections department.

Fourteen lawmakers were appointed Thursday to develop specific recommendations in coming months.

Maynard, who has retained O’Malley’s public support, recounted to lawmakers how his first order of business after the indictments was to ensure that the leadership of the jail had not been involved in the conspiracy and could be trusted to carry out reforms.

Maynard said he set about “vetting” top jail administrators, including the security chief, Shavella Miles, who was fired last month. “That’s where we came upon the security chief that didn’t pass the polygraph, that didn’t pass the interview,” Maynard said. “We removed her.”

Rick Binetti, a corrections spokesman, sought to clarify Maynard’s remarks. Binetti said that although Miles failed a polygraph and was fired, she wasn’t necessarily fired because she failed the test. A man who answered the phone at Miles’s home referred questions to an attorney, who did not immediately return a message.

Miles, who has denied wrongdoing and is protesting her dismissal, was the third-highest-ranking official at the Baltimore City Detention Center before her removal. Her firing remains the only consequence of the jail scandal that has extended into the ranks of management.

In response to generally polite and restrained questioning Thursday, Maynard defended his leadership but said the investigation may reveal more wrongdoing.

“How can the low-lying employees be the only ones culpable?” Sen. Nathaniel J. McFadden (D-Baltimore) asked at one point, eliciting Maynard’s testimony that they might not be.

Throughout his appearance, Maynard maintained that he and his department had taken a proactive role in a task force that led to the federal prosecutions.

He said he recognized that the department’s interest in exposing corruption came with “a strong risk of embarrassment.” But, he said, “we moved forward, and if I had it to do all over again, I would do it exactly the same way. It is the only way to get at the root cause, and as a result, it becomes the right thing to do.”

Maynard also said Thursday that he thinks the 200-year-old jail should be replaced but said the location presents challenges for rebuilding while continuing to use the facility.

Others who testified Thursday — including Gregg Bernstein, the state’s attorney for Baltimore, and Scott Shellenberger, the state’s attorney for Baltimore County — urged lawmakers to stiffen penalties for corrupt guards and others who smuggle cellphones into correctional facilities, a key element of the gang culture that thrived in the Baltimore jail. Bills that would have done that have died for four years in a row in the House Judiciary Committee. Bernstein suggested upgrading the offense from a misdemeanor to a felony for those caught a second time.

Shellenberger agreed and also suggested that officers with arrest powers be stationed in correctional facilities so that guards who are implicated could be immediately apprehended rather than face administration procedures.

“You don’t go home . . . but you’re put in handcuffs, and you’re escorted out of the institution,” Shellenberger said.

The audit of the Baltimore jail system by the National Institute of Corrections that was released Thursday said some “holding cells are uniformly dirty with almost every HVAC vent clogged with toilet paper and in one case, bread from uneaten sandwiches.” It also noted that janitor closets are “routinely left open,” presenting “a serious security breach.” Detention officials also routinely failed to return inmates’ driver’s licenses when they were freed, the audit found, meaning “that approximately 800 to 1,000 people are released each year without their personal identification.”

As the three-hour hearing unfolded, O’Malley’s office released more than 130 pages of e-mails, memorandums and other documents requested over the past month by news organizations. They included efforts by O’Malley’s staff to frame the public message as the governor’s office tried to deal with the news coverage.

In an e-mail dated May 2, Catherine Motz, O’Malley’s deputy chief, asked U.S. Attorney Rod J. Rosenstein to co-author an op-ed that would describe the indictments as “the product of months — and in fact years — of hard work and unprecedented partnership between the U.S. Attorney’s Office the State of Maryland and federal law enforcement.”

Rosenstein declined: “I do not want to co-author an op-ed. However, I have made some suggested edits to your draft.” The edits were not visible in the e-mail. An aide to the governor said the op-ed was never published.

Documents released in response to the public records request also show that as far back as January 2011, the governor was aware that corrections officials were doing a poor job of policing their own. In its final report to the governor, a task force on prison violence estimated that about 50 percent of contraband is smuggled into Maryland correctional facilities by staff.

“Unfortunately, most of the staff are not prosecuted and usually resign prior to the start of any criminal proceeding,” the report said.

There was also an e-mail exchange between O’Malley and Baltimore Mayor Stephanie Rawlings-Blake (D) upon the governor’s return from a trade mission to Israel, where he was when federal prosecutors called a news conference to announce the indictments on April 23.

“Can I call you sometime today on BCDC?” the governor wrote. “Really pissed I was out of town when these indictments were finally announced. Did a lot of press yesterday — we’d been working towards these indictments for a year and a half.”

Rawlings Blake responded that she had been trying to get on the governor’s schedule, and O’Malley said he would make the meeting happen.

“There’s a lot to this investigation,” O’Malley continued. “Not withstanding the half-hammed way the press-roll out was handled. . . . Don’t fall for the bait that somehow Gary and I were asleep at the switch. We were not. We (state, Gary, and I) went after this.”

Peter Hermann and Annys Shin contributed to this report.