Maryland Gov. Martin O'Malley. (Photo by Chip Somodevilla/Getty Images)

Maryland Gov. Martin O’Malley (D) acknowledged in an interview that two episodes that emerged last year — the Baltimore jail scandal and the state’s botched rollout of its online health insurance exchange — run counter to his reputation as an effective manager.

But O’Malley, who is preparing for a possible 2016 White House bid, said those events should not be considered “in isolation.”

“The reputation of any administration is the sum of its work,” O’Malley said in the interview last week. “You can’t define an administration by one or two successes. You can’t define an administration by one or two shortcomings.”

More than two dozen guards from the state-run Baltimore City Detention Center and an adjacent facility were indicted last year for allegedly conspiring with members of a dangerous prison gang in drug- and money-laundering schemes. The gang leader at the center of the case had impregnated four of the jail guards.

O’Malley said in retrospect that he had not done enough to “prepare people” for the “very salacious and ugly fact situation” that emerged in the federal indictments. And he said it had largely been lost in the news coverage that his administration invited federal authorities to help root out corruption at the state institutions.

“I didn’t communicate as effectively as I should have up front the depth of our problems and the depth of our integrity challenges. I wish I had,” O’Malley said. “So as a result, when it came out, people felt like they were surprised by it. Live and learn. I should have done a better job of preparing people for that.”

O’Malley said that long before the indictments, state corrections officials had been pursuing strategies to target corruption, including raising two or three litters of dogs trained to sniff out cellphones smuggled into the jail. Cellphones have long been a problem in jails and prisons because they allow inmates to coordinate illegal activities with one another and associates outside.

While Maryland’s online health insurance exchange has been riddled with technical glitches since its Oct. 1 debut, O’Malley said the state remains committed to getting it right. And he noted that several other of his initiatives had taken more than one try before they were successful.

O’Malley said he failed in initial attempts, for example, to get the General Assembly to legalize same-sex marriage, repeal the death penalty and adopt legislation that provides incentives to jump-start the wind-power industry off the Atlantic coast near Ocean City.

“We haven’t succeeded at every first try,” O’Malley said. “We’ve never given up. It’s the openness and the relentlessness that has been a hallmark of this administration, and it’s the reason we succeed, not always at first try, but we do succeed.”

In the interview, O’Malley also offered praise for Lt. Gov. Anthony G. Brown (D), whose tasks have included overseeing health-care reforms in the state. O’Malley, whose second term expires in January, has endorsed Brown as his successor and said he has “all the makings to be an outstanding governor.”

“Anthony has not only a grasp of the complexity of state government, but he also has the ability to be the modern operational leader that these times require,” O’Malley said. “He’s not intimidated by details. He has a great mind and also a very keen instinct for always asking, ‘How does this affect real people?’ ‘How does this work from the perspective of a citizen?’ ”

“I’m excited about his candidacy, and for the good of my state, I believe he’s the very best candidate out there,” O’Malley said.