Wayne Messam, the mayor of Miramar, Fla., has ended a presidential campaign that barely got off the ground.

Mr. Messam, 45, announced his decision on Wednesday in a post on Medium.

“I jumped in an already crowded field of capable candidates to change the direction of this nation caused by the dysfunction of Washington and the poor leadership of the current presidency,” he said. “I knew the odds were a steep hill to climb but I have always fought for what is right and will continue to break barriers never broken.”

Mr. Messam declared his candidacy for the Democratic nomination on March 28, discussing student debt, prescription drug costs and clean air, and telling CNN that he wanted to provide “the leadership that will make these issues a priority and have the political will to solve these issues for the American people.”

He touted his background as a son of Jamaican immigrants, a former professional football player, a small-business owner and a mayor. But he did not articulate a vision that distinguished him from the many other candidates in the field, most of them better known and more politically experienced.