Maynard and other state officials have faced questions about how much they knew about the alleged corruption under their watch.

But the corrections department has said it had called on the FBI and other agencies to begin investigating back in 2011.

O'Malley was abroad when federal authorities unsealed the April case and wrote to Baltimore Mayor Stephanie Rawlings-Blake that the initial announcement made it appear as though the corrections department was "asleep at the switch." In reality, he said, the case represented a major, cooperative step against the Black Guerrilla Family gang.

Maynard resisted calls to resign and sat through hours-long grillings by legislative leaders. He moved his office from the department's Towson headquarters to the jail, laboring to improve security at the Civil War-era jail and weed out corrupt officers.

In an interview shortly after the federal indictments, Maynard pledged to stay in the job "until it's fixed."

"I may put a little bow on it and say, 'This is one of the better running jails in the country.' And maybe in a year or two, walk away from it," he said at the time.

In recent weeks, corrections officials have touted their success so far, citing reduced contraband smuggling and violence at the Baltimore jail even as a new round of charges last month implicated another 14 corrections officers in the corruption scandal.

Maynard started in corrections in 1970 as a prison psychologist in Oklahoma and went on to run prisons there, as well as in South Carolina and Iowa, earning accolades for his hands-on approach and willingness to resolve a crisis.

Last year, he was honored by the top award from the Association of State Correctional Administrators.

O'Malley recruited Maynard shortly after taking office, and their first order of business was to shut down the state's notoriously dangerous House of Correction in Jessup, where a corrections officer had been killed.

Maynard and O'Malley attended a vigil for another guard who was injured, and the governor pledged that his administration would "move just as quickly as we can to create a safer environment."

Ten days later, officials shuttered the House of Correction, sending Maryland's most violent offenders out of state and transferred the remaining inmates to other prisons — moving 842 inmates without any advance notice.

Maynard will join the Criminal Justice Institute, a nonprofit that provides advice to law enforcement agencies.

In the email to staff, Maynard recounted his achievements and praised his employees.

"At the same time, it's very hard to leave this Department," he wrote. "These past seven years have been the most challenging and rewarding in my entire career."

Baltimore Sun reporters Colin Campbell and Justin Fenton contributed to this story.