Maryland Gov. Martin O’Malley prepares to take his seat at a table at the start of the New Hampshire Democratic Party’s 2013 Jefferson-Jackson Dinner. (Mark Bolton/Union Leader)

MANCHESTER, N.H. — In a speech to New Hampshire Democrats on Saturday, Maryland Gov. Martin O’Malley (D) compared the distressed mind-set of Baltimore when he took over as mayor in 1999 to that of the nation today.

O’Malley, who is weighing a 2016 presidential run, told a crowd of close to 1,000 party activists here that the city he sought to lead had succumbed to a “culture of failure,” with open-air drug markets, a soaring murder count and citizens “wallowing in a sense that nothing would work.”

“Like in Baltimore in 1999, we as Americans are going through a cynical time of disbelief, a time with more excuses and ideology than cooperation or action,” O’Malley said in his keynote address at the annual Jefferson-Jackson dinner. “We seem to have lost the shared conviction we once had that we actually have the ability to make things better together. There is a big difference between the America we carry in our hearts, and the America we see in our headlines.”

O’Malley’s appearance in the nation’s first presidential primary state came at a delicate time for him politically. While O’Malley has openly acknowledged his interest in a possible White House bid, the prospect of a 2016 campaign by Hillary Clinton has overshadowed interest in other potential contenders.

O’Malley’s speech was preceded by a three-minute video recounting his leadership in Baltimore and during his tenure as governor, which began in 2007. Among other things, it featured his implementation of CitiStat and then StateStat, initiatives designed to measure progress and drive decisions about governing. The biggest applause came as the narrator relayed O’Malley’s support for the legalization of same-sex marriage.

The governor’s speech also included a robust defense of President Obama and a blistering critique of tea party Republicans, including Sen. Ted Cruz (R-Tex.), who he accused of “twisting the words of our founders to justify their own mean-spirited, short-sighted, pro-shutdown ideology.”

“We’ve had enough of tea party Republicans like Ted Cruz, haven’t we?” O’Malley said. “What Senator Cruz doesn’t understand is that the patriots who founded New Hampshire and Maryland didn’t pray for their president to fail. They prayed for him to succeed.”

The crowd included a contingent of Marylanders. Among them were a former O’Malley chief of staff and communications director and O’Malley’s 16-year-old son, William.

Cards left on the seats at the dinner invited New Hampshire Democrats to “stay in touch” with O’Malley, offering the names and numbers of two of his political staffers and ways to follow him on social media.