In 1999, an audience member asked a question during a Baltimore mayoral debate that boiled down to this: “Why should we stay here?” It was a reasonable ask. The city was a mess. The urban renaissance that had begun to bring cities like New York and Los Angeles back to life had passed Baltimore by. Baltimore was the most violent city in America. There was only one single public school grade where most of the students were proficient in reading or math. Blocks and blocks were run-down and empty.

Many Baltimoreans had already gotten the hint. The city’s population dropped 40 percent from its peak 40 years earlier. Baltimore County, the questioner pointed out, was minutes away. There, crime was less frequent, schools were better, taxes were lower. Why shouldn’t we all get the hell out of here?

On that debate stage was Martin O’Malley, a little-known city councilman running a decidedly longshot campaign for mayor. He answered that the questioner and families like hers should stay in the city because if he was elected, he would bring it back, make the place worth living in again.

It sounded laughable. Ludicrous, even. This was Baltimore. The city was believed to be unmanageable. William Donald Schaeffer was credited with helping keep the city afloat in the 1970s and 1980s, but by 1999 his antics had started to seem like stunts. His crowning achievement, the gigantic Inner Harbor, a waterfront mall, was out of step with the revitalization happening in cities across the country. Kurt Schmoke was affable and brilliant, a former Rhodes Scholar and someone seemingly overwhelmed by the task of managing a city. By 2000, Baltimore was becoming less known in the popular imagination as the city of John Waters’ zaniness or Barry Levinson-fueled nostalgia but as the setting of gritty crime dramas like Homicide: Life on the Streets.

Not that anyone paid much attention to what O’Malley said. He stood almost no chance of winning, a white politician in a city that was majority African-American and that had proudly elected its first black mayor in Schmoke. Yet by promising to no longer ignore the spiking crime rate and to bring opportunity back to neighborhoods long neglected, O’Malley swept into office, beating his two opponents in even the city’s most violent and poverty-stricken neighborhoods.

“I didn’t run for mayor because everything was going great in Baltimore in 1999,” O’Malley said in a phone interview this week while awaiting a connecting flight in “whatever the hell airport I am in in Chicago.” (“It’s okay,” he added. “This is the life I have chosen.”)

“I ran for mayor because our city was hurting, and our people were hurting and we were burying more and more young men by violent death per capita than any city in America,” he told The Daily Beast. “The attitude in Baltimore in 1999 was almost one of resignation, that our problems were bigger than our capacity to handle them.”

Because it is seemingly impossible to discuss current events without political narratives overtaking them, O’Malley’s tenure in Baltimore has come under scrutiny—his decade-old role in City Hall now being blamed for the unrest now engulfing the city, or even the behavior of violent cops. Some of this is O’Malley’s own doing. As Baltimore erupted, he promptly cut short a scheduled trip to Europe and planted himself among the chaos.

And so now that O’Malley has embarked on an even longer-shot presidential campaign, the visuals of O’Malley’s record being seemingly undone before him are too good to resist.

And oddly, considering the incoming he has taken in recent days, O’Malley said he welcomes the scrutiny.

“It is important to talk about the biggest issues we are facing as a country, which is that it is not about our cities not working. It is not about government programs that don’t work. It’s about an economy that doesn’t work, that tells a huge portion of our fellow citizens that they are unneeded and unnecessary,” O’Malley said.

“That’s the pool of kerosene that is beneath the match of these police incidents.”

From 2000 to 2010, the incidence of crime in Baltimore dropped 43 percent, outpacing by a stretch the 11 percent drop that the nation saw during that period. The crime rate dropped by 40 percent. Graduation rates rose. Median home prices doubled. A new biotech park was built on the city’s east side. A new performing arts center was built on the west side. O’Malley was obsessed with numbers and metrics, and set up a 311 call center to track citizen complaints. A program called Project 5000 enlisted volunteer attorneys to help deal with the city’s massive vacant home problem as titles to those homes was eventually transferred to individuals and nonprofits for redevelopment. The school system was pulled back from the fiscal brink. CitiStat, designed to track crime, helped bring the crime rate down and created a budget surplus of $54 million that was then reinvested in schools and programs for children. At last, the population stabilized. It was no longer necessary to flee, if you could. The number of college-educated 25-to-34-year-olds living within three miles of downtown Baltimore increased 92 percent in the 10 years after O’Malley became mayor, fourth among the nation’s 51st-largest metro areas.

Time magazine named O’Malley one of the five best big-city mayors in America. Esquire named him the best young mayor in America. CitiStat won Harvard University’s Kennedy School of Government “Innovations in American Government Award.”

To be sure, change was both too fast and too slow. The blight and poverty remained. And although crime dropped, O’Malley’s zero tolerance policing policy created a backlash in the very communities it was designed to protect. But those policies were not as unpopular as the rioting now in the streets of Baltimore would suggest.

“I don’t recall O’Malley stating that he would do something about ‘black crime,’ just crime,” wrote liberal Baltimore Sun columnist Dan Rodericks toward the end of O’Malley’s time in City Hall. “Coming out of the long, dreary Schmoke years, Baltimoreans appreciated O’Malley’s almost singular focus, along with millions in increased funding dedicated to drug treatment for the city’s thousands of addicts who contribute, directly and indirectly, to 80 percent of crime.”

“He was trying to stop the crime on the streets. People were getting killed daily on Old York Road and in Park Heights,” Robert Nowlin, a Baltimore community activist, told The Daily Beast . “He did something a lot of these mayors don’t do: He walked with the small people. A lot of these mayors stay in the affluent areas. He walked the streets.”

Only two former mayors have served in the White House, and it has been a long time since any major presidential candidate had a City Hall stint (other than one in New York) on his or her resume. It’s no wonder why. The problems facing America’s cities are so severe that anyone with visions of higher office better look for a job elsewhere. But attempting to face up to that challenge, and chip away at it in the manner that he did—however overzealous and incomplete—is what actually qualifies him for office, O’Malley says.

Drawing a bright red line between the Clinton and Bush years, O’Malley said, “We haven’t had an agenda for our cities in 30 years. It is not something you solve with a nifty pilot program. It is not something you solve with philanthropy or with a thousand points of light. When you create an economy where you subsidize corporate profits through a welfare program and food stamps in order to keep wages low in some perverse pursuit of ‘competiveness,’ than you reap the fruits of the anger that you sow. And that is what is happening in our country today.”

Tying O’Malley to Baltimore is an old political saw. When he tried to run for governor of Maryland, Republicans ran ads with flashing police lights, talked about how O’Malley would do for Baltimore what he did for Maryland. O’Malley won statewide twice though, boosted by those same Baltimore neighborhoods that he is now blamed for turning into powder kegs.

“I don’t think there is another person in this race who has had the executive experience over the spectrum of America that I have had as mayor of a very troubled city on its back,” said O’Malley. “I saw that gap between who we think we are and who we really are as a nation.”