BALTIMORE — In another campaign year, Martin O’Malley’s résumé and good looks might be irresistible to Democratic primary voters. He is a former big-city mayor whose story of renewal in Baltimore seemed well tailored to an increasingly urban and minority party. He is a former two-term governor of Maryland — and the lead singer and guitarist in a rock ’n’ roll band.

But Mr. O’Malley is running in an election cycle in which Democratic elected officials and donors have overwhelmingly focused attention on Hillary Rodham Clinton. And he already faces competition from Senator Bernie Sanders of Vermont for the support of liberals who dislike Mrs. Clinton or merely want to see her pushed further to the left.

After a two-year exploratory phase, Mr. O’Malley, 52, on Saturday began to make a case for why Democrats should bet on him instead of on Mrs. Clinton or Mr. Sanders. His argument was both economic and, in a clear contrast with his significantly older Democratic rivals, generational.

“Today, the American dream seems for so many of us to be hanging by a thread,” he said, announcing his candidacy before hundreds of supporters under a baking sun in Federal Hill Park in Baltimore’s Inner Harbor, with the towers of the city’s downtown behind him.