"I want to come together as a community and make sure we connect and do the right things for every part of our community," said Batts, who became commissioner late last year. "If there's more that we can do, if there's more that I can do, I am here to serve you."

Kenni Shaw, 30, who also attended the rally, says he was attacked outside D & M Liquors, on the corner of North Milton Avenue and East Hoffman Street, because he is gay. Activists want the incident treated as a hate crime, but police, who are still investigating, said that at the moment the evidence does not support the classification, which can bring heftier sentences.

In a show of support for Shaw, the group gathered at noon on North Gay Street — a happy coincidence, said the Rev. Kinji Scott, one or the rally's organizers — and walked with him the few blocks to the liquor store.

"A lot of people don't speak up," Shaw said. "I made it through this situation and I wanted to use my voice."

On Saturday the whites of Shaw's eyes were still reddened from the beating, which, according to a picture he posted to the photo-sharing site Instagram, left his face badly swollen.

The attack on Shaw has attracted the attention of gay-rights activists, community leaders and public officials, who mounted steps outside the store and stood under its yellow awning to deliver speeches decrying violence.

In an interview, Batts said the decision on whether to handle the case as a hate crime will rest with the state's attorney's office. "We do the part of gathering evidence," he said.

Scott, a gay Baptist preacher, said in an interview that he is generally happy with how police have handled the case so far. He plans to meet with officers privately to push for the hate crime classification. But, he added, the rally served a broader purpose: showing gay blacks that they can stand up and talk about crime.

"In our community in the past we've had people beat, raped and murdered, but we've not had much action in terms of violence against black gay men," Scott said. "You have Kenni Shaw who is willing to stand up when most people are quiet and afraid."

Shaw, a cosmetologist and hair stylist, told The Baltimore Sun shortly after the attack that a group of five men rained down blows on his head as he left the liquor store. In the past, he said, he has been subjected to verbal abuse in his neighborhood.

Representatives from the National Black Justice Coalition, a civil rights organization that campaigns against homophobia, said the group had brought Shaw's case to the attention of the U.S. Department of Justice as an example of the "crisis of violence" affecting black gay people.

Other activists and officials also joined the rally, including local NAACP head Tessa Hill-Aston, City Councilmen Carl Stokes and Nick Mosby, and Kevin D. Cleary, a mayoral aide who works with the gay community.

Carrie Evans, the executive director of Equality Maryland, which campaigned for the state's new same-sex marriage law, compared that legislative victory with the more basic problems many gay people still face in their day-to-day lives.

"What happened to Mr. Shaw just shows how much we have to do on the ground," she said.