Maryland Gov. Martin O'Malley speaks in support of a same-sex marriage bill during a news conference in front of supporters in this 2012 file photo. (Patrick Semansky/AP)

Maryland Gov. Martin O’Malley (D) called a heating company recently to set up an account for the family’s new house in Baltimore. The woman on the line asked for his last name.

“O’Malley,” he replied, “like the outgoing governor.”

“Ah, yes,” she said, “the tax man.”

The exchange, recounted on O’Malley’s blog, was a stark reminder that after eight years of setting and implementing one of the most progressive agendas in the nation, O’Malley is known in Maryland for something else entirely: raising taxes.

Increases in the sales tax, gas tax, income tax and more have become the most-talked-about part of his tenure, in large part because of the successful gubernatorial campaign of Republican businessman Larry Hogan. En route to his upset of O’Malley’s longtime deputy, Hogan accused O’Malley of 40 straight tax increases and convinced Marylanders that it was time for a change.

Where is Gov. Martin O'Malley?
Maryland Gov. Martin O’Malley has traveled across the country since January 2013 to campaign and raise money for other Democrats and lay the foundation for a possible bid for the White House.

(Denise Lu and John Wagner/The Washington Post)

But O’Malley’s time in Annapolis is also the story of an unbowed liberal champion, who muscled through a string of policy changes that will endure long after he departs Wednesday. Gay couples in Maryland can now marry; the state no longer executes prisoners; minimum-wage workers are getting pay increases; and undocumented immigrants can qualify for in-state college tuition rates. It is harder to buy a gun.

The state spent record amounts on education and more on roads, despite a recession, and there were steep drops in crime and a dramatic increase in people covered by subsidized health care — improvements made possible, O’Malley boosters say, by the very tax increases that became so reviled.

“I’ve done what I think is the right thing to do for the common good of the people I serve,” O’Malley said in an interview. “If you look objectively at what this administration was able to accomplish . . . you’d say it was a very productive and effective eight years.”

O’Malley’s tenure had a few high-profile missteps, most notably the botched rollout of the state’s online health insurance marketplace. Detractors say he is leaving behind an overtaxed state, which has made it hard for businesses to thrive, as well as an unchecked heroin epidemic. And liberal advocates are nervous about unfinished business — including the long-planned light-rail Purple Line that O’Malley championed. Hogan’s win, they say, was a gut punch to Democratic priorities.

“It’s definitely going to be much harder to work on issues like climate change and energy when the administration is no longer one of your biggest allies,” said Karla Raettig, executive director of the Maryland League of Conservation Voters, a leading environmental group.

O’Malley arrived in Annapolis in 2007 after toppling the state’s last Republican governor, Robert L. Ehrlich Jr. At 43, he was brash and ambitious, a former mayor of Baltimore who built his political reputation on fighting crime and pioneering a system of statistics-driven government that drew national and international attention. He was also well-known as the front man for a Celtic rock band popular in Baltimore bars.

The new governor immediately set out to strengthen the middle class, boost public safety and education, and improve health care and the environment. He froze public university tuition and dramatically increased funding for school construction.

Gov. Martin O'Malley takes a selfie with Nadia and Brian Morgan of Baltimore as he enters the gambling floor on opening night at the Horseshoe Casino in August in Baltimore. (Bill O'Leary/The Washington Post)

Some of the high-profile changes that would become defining parts of his tenure were not on his radar screen in the beginning. O’Malley did not embrace same-sex marriage as a top priority, for example, until 2012, after it had failed in 2011 and supporters were looking for a champion.

A big test came late in O’Malley’s first year, when he called lawmakers back to Annapolis to resolve a long-standing “structural deficit” in the budget, namely the state’s practice of planning to spend more money than forecasters expected it to collect in revenue.

O’Malley offered a package of tax increases and budget cuts, as well as a plan to raise additional revenue by legalizing slot machines — a poisonous issue for much of Ehrlich’s term.

Legislative leaders cautioned against holding such an ambitious special session — particularly with no guarantee of success. But O’Malley pushed through his entire package, with some bills squeaking by after debates that stretched into the wee hours. He had established himself as a force to be reckoned with, even though some efforts — such as repealing the death penalty — didn’t succeed right away.

In the end, there was no major O’Malley initiative that didn’t make it across the finish line. In some cases, he showed a willingness to compromise that frustrated his allies — like slowing the pace of pay increases in a minimum wage bill.

O’Malley’s reliance on tax increases to balance the budget ignited a debate that continued through the 2014 election, in which Hogan proclaimed that O’Malley and Lt. Gov. Anthony G. Brown (D) “never met a tax that didn’t like or at least one they didn’t hike.”

High earners pay more in income taxes than they did eight years ago. So do corporations. Sales tax is up. Smokers pay more in tobacco taxes. Drinkers pay more for alcohol. And motorists pay more taxes at the pump and higher fees at toll booths.

O’Malley has also made multiple rounds of spending cuts — more, he said Friday, “than any administration this side of the Depression.” But critics, including some Democrats, say the governor was insensitive to the cumulative impact of the tax increases. His standing among Marylanders reached a low point in a Washington Post poll in October, when only 41 percent said they approved of the job he’s doing.

“Economically, he just went beyond the tipping point,” said Sen. James Brochin (D-Baltimore County). “There was no understanding of what impact those fees and taxes were having on people who were trying to make a living in a tough economy.”

O’Malley bristles at that characterization. “I grew up one of six kids, and I served as mayor of Baltimore,” he said. “I have known and been near and with and in homes of people all across our state of very humble means.”

He notes with pride that in 2013 the Tax Policy Center, a joint project of the Urban Institute and the Brookings Institution, ranked Maryland’s state and local tax burden fourth-lowest among the states as a share of personal income.

O’Malley’s defenders say the state would have had to make far deeper cuts to education, health care and other valued programs if he hadn’t found ways to raise additional revenue — especially during the recession.

“He did what he thought he needed to do,” said Sen. Robert A. Zirkin (D-Baltimore County). “Martin’s philosophy is that these were good programs.”

But the structural deficit has endured despite O’Malley’s attempts to eliminate it — thanks mostly to Maryland’s still-sluggish economy and federal spending cuts that are taking a toll on the entire Washington region.

Hogan is inheriting a $750 million projected shortfall. And though O’Malley on Friday offered a list of cuts for his successor to consider, it is no longer his job to set spending priorities for the state.

When asked about his legacy, O’Malley talks as much about how he governed as what he did. Early on, he ushered in StateStat, Maryland’s version of the CitiStat program he had pioneered in Baltimore. Online charts, graphs and maps now track data on topics ranging from infant mortality to sources of pollution in the Chesapeake Bay to the number of children living in foster care (far fewer than before O’Malley’s tenure).

“These are not genies that are going back in the bottle,” O’Malley said of his data-driven approach. “This is the new way of governing. . . . This is how people expect their state to function in the future.”

O’Malley’s future is very much up in the air. He has flirted with a national political audience by heading the Democratic Governors Association, speaking at the 2012 Democratic convention and making repeated visits in the past year to early primary states. He says he will decide this spring whether to launch a long-shot bid for the White House.

In the meantime, O’Malley will go on the paid speaking circuit and teach at Johns Hopkins University.

O’Malley was clearly stung by Brown’s loss to Hogan, especially since registered Democrats outnumber Republicans 2 to 1 in Maryland. “I can tell you my feelings were hurt,” he told an audience this month at the University of Chicago. “We had done a lot of really good things in Maryland, and in the end, you did not hear much about it during the campaign.”

O’Malley says Brown should have done more to defend his and O’Malley’s record, to push back against Hogan’s caustic portrayal of O’Malley as the tax man. He notes that he easily won a second term in 2010, after most of the tax increases were in place, and credits his campaign that year for making clear to voters what they were getting as a result of the additional tax revenue.

Senate President Thomas V. Mike Miller Jr. (D-Calvert), whose political career stretches back decades, said voters in time will come to appreciate the tough decisions O’Malley had to make and how well the state fared under his leadership.

“We have much to be proud of, and he’s largely responsible for it,” Miller said. “People will remember him as the Irish troubadour who cared about people.”