Syed Riz Hussain, 21, center, of Edison, N.J., and other Shia Muslims beat their chests in unison to express communal mourning for Imam Husain during a gathering in Washington. (Sarah L. Voisin/The Washington Post)

Hundreds of Shiite Muslims turned a major annual spiritual ritual into an anti-terrorism rally Sunday, marching, singing and praying for hours from trendy Dupont Circle to the White House as tourists and brunch-goers rubbernecked.

Connecticut Avenue was a sea of black as Shiites mostly from the D.C. region waved banners with the name of their spiritual forefather, Imam Hussein, and pounded their chests with their fists simultaneously as an expression of mourning. His martyrdom 1,400 years ago is a major part of Shiite narrative and a defining event in the break between Shiite and Sunni Muslims, and is marked annually. A few days ago, more than 22 million Shiites and others visited the Iraqi city of Karbala in a pilgrimage to the place where Hussein died.

But this year the event twinned as a peace march. Muslims — including head-covered women, young children and hipsters with man buns on hoverboards — held signs condemning terrorism and the Islamic State and handed out hot chocolate and doughnuts in an effort to open conversations with passersby.

Some American Muslim groups and prominent U.S. Muslims have been making extra public efforts since the recent terrorism-related killings in San Bernardino, Calif., to speak against the Islamic State terrorist group, which is also known as ISIS, and radical Islamists.

“What’s happening now is we feel even more compelled to come out of our homes,” said Zehra Raza, 27, an electrical engineer from Alexandria, Va., who was at the rally with her husband.

The crowd was smaller than in past years, she and others said, because many Muslims were afraid of being harassed or targeted with violence. Such incidents have been on the rise. Many police officers were on hand, and there were no obvious protests against the rally.

When the crowd arrived at Lafayette Park across from the White House, tourists pulled out their cellphones. One group from Poland attempted in broken English to explain to a pair from Colombia what was going on.

“Some [Muslims] were afraid, but I think this is the perfect time to come out and stand with people who are oppressed. ISIS is the same as what Hussein was fighting 1,400 years ago,” Raza said.

ISIS has persecuted Shiites — among other religious minorities — in Syria and Iraq, called them infidels and killed them.

As Raza spoke, and offered strangers Krispy Kreme doughnuts, a woman from outside the group approached her to offer support and give her a hug. “God bless. Or whomever bless — the universe bless,” the woman said as she walked away.

Many of the signs echoed the views of marchers — that Shiites are victims of ISIS, and in particular of the Wahhabi branch of Islam that dominates Saudi Arabia. The front row of the marchers was a phalanx of young boys holding posterboards with words such as “Americans unite against Wahhabi terrorism,” “Muslims against ISIS” and “American Shia Muslims stand with the victims of San Bernardino.”

Ali Alkhafa, 23, a University of Maryland student who grew up in California but was born in a Saudi refugee camp, said Muslim Americans are hindered from being a louder voice against terrorism by their own internal divisions.

“Muslims aren’t as vocal as we need to be,” he said as the sound of men thumping their chests punctuated the air. “It’s cultural. We’re welcoming but not as open to one another as we should be. My folks’ generation are still isolated [by ethnic group], but my generation is really open.”

The crowd appeared conservative. Men and women marched mostly separately, and women’s heads were covered. However, participants said they were more ideologically diverse, and were deferring to the more traditional gestures out of respect for one another. In the mix were convenience store managers, emergency room doctors and chemistry teachers.