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)

Four years ago, Maryland’s top corrections official vowed that a scandal at a state prison in Baltimore involving violent gang activity and corrupt guards was not widespread.

But this week, Gary D. Maynard, secretary of public safety and correctional services, found himself confronting a nearly identical crisis at a detention center next door, with 13 corrections officers charged with helping the same Black Guerilla Family gang launder money, have sex with guards and give orders to the street.

The activity was so brazen, the FBI said, that in addition to smuggling in cellphones and drugs, four guards became pregnant by a single detainee, and the names of 14 guards available for trysts were written on a jailhouse wall — along with prices for various sexual favors.

A top FBI agent said the “inmates literally took over the asylum.”

Maynard said Thursday that a gang and anti-corruption task force launched after the 2009 arrests at the prison complex led to this week’s indictments at the jail. He said that more than $1 million was spent on new screening measures and other security and that authorities identified the jail, which houses up to 3,500 detainees awaiting trial, as another site of collusion between suspected criminals and their guards.

Tavon White (Courtesy of Anne Arundel County Police Department )

Six months ago, Maynard removed the top administrative official at the jail because of leadership concerns. “This is one of those things that didn’t happen overnight,” he said of problems at the jail, which is north of downtown Baltimore. “And it won’t be solved overnight.” Corruption and gang activity, he added, have “been an issue for this jail system in Baltimore for many years.”

But Maynard’s explanation may not satisfy other Maryland officials, who are calling for a deeper investigation of the state prison system. And he hasn’t explained how his department could have missed what in some instances, according to prosecutors, amounted to blatant evidence that corruption was occurring.

The corruption scandal casts a new light on Maynard’s tenure in Maryland, which began six years ago with great promise that he would usher in badly needed reforms. It also comes at a sensitive time for his boss, Gov. Martin O’Malley (D), who is weighing a 2016 presidential bid.

Del. Joseph F. Vallario Jr. (D-Prince George’s), chairman of the House Judiciary Committee, said Thursday that his panel will have a hearing May 8 on “corruption at Baltimore City Detention Center.”

“Obviously, it’s an embarrassing situation for everyone,” said House Speaker Michael E. Busch (D-Anne Arundel). “We need to get an accounting of how we got to this point. If you believe everything you read, it’s pretty incredible to imagine, that some individual could have that type of control in what is supposed to be a secured setting and not its own subculture.”

Maryland Senate President Thomas V. Mike Miller Jr. (D-Calvert), who said most lawmakers still have confidence in Maynard, expects O’Malley to quickly address the issue when he returns from an eight-day trade mission to Israel that began Saturday.

The state began running the city jail in the early 1990s because of corruption and poor conditions. Unlike a prison, which houses convicts, the detention center is a temporary holding facility, and it is among the nation’s busiest, with about 80,000 people passing through every year.

Judicial delays have long been a problem in Baltimore. Tavon White, the alleged BGF leader charged in the indictment, had been in the jail for three years on an attempted murder charge. Two trials ended in hung juries; his third trial had been scheduled for Wednesday but was postponed.

“That’s a problem,” Maynard said. “The longer these people stay there, the more entrenched they get, and the more difficult they are to deal with.” Officials have said they suspected that White was a ringleader of the conspiracy, but they left him at the jail to avoid disrupting an FBI investigation.

Maynard said he could not comment on how other signals were seemingly missed, such as the list of guards willing to exchange sex for money or the fact that some guards had the names of inmates tattooed on their bodies. In both cases, guards openly bragged about how tough it is to be fired from the civil service job.

Maynard also said he did not know that one of the corrections officers indicted this week had been the subject of a 2006 civil lawsuit brought by an inmate in federal court alleging that she left his cell door unlocked so he could be attacked by gang members and that she withheld treatment for his 32 stab wounds.

The victim’s attorney argued that the attack was part of a larger problem of gangs infiltrating the ranks of corrections officers. The guard denied colluding with inmates; the two sides settled before going to trial. The guard kept her job, despite court records showing that the victim had uncovered a confidential report prepared in 2006 by a prison intelligence unit that identified 16 guards — including the one named in the suit — with ties to gangs such as BGF.

Baltimore Police Commissioner Anthony W. Batts, who spent most of his 32-year career in California and was chief of departments in Oakland and Long Beach before coming east in September, said he has long experience with gangs.

He attributed a spike in violence last year in Baltimore to BGF, which he said has its “command and control” behind jailhouse walls and used violence to try and take over the drug trade on the city’s west side. “Some of the gangs pushed back, and we had a multitude of murders at the end of last year,” he said.

This year, Batts said, he has put more police in some neighborhoods in West Baltimore, and he now uses an intelligence unit to gather background on victims who are gang members to feed to detectives at a shooting scene.

Violence is still going up on the west side, where 17 people have been killed this year, compared with eight at this time in 2012. Not all the slayings are attributed to gangs, Batts said, but he called BGF “public enemy number one for our city.”

Annys Y. Shin and John Wagner contributed to this report.