A day intended to be one of celebration and jubilance for Washington’s gay community took on a more somber tone Sunday as participants reacted to reports that the gunman who killed at least 50 people in an Orlando gay nightclub may have targeted them because of their sexual orientation.

Sunday’s Capital Pride Festival, which attracted hundreds of thousands of people, became a symbol for participants who said it represented both the recent triumphs of the LGBT community but also underscored the work that remains. There is still hatred. There is still reason to fear. Even in a moment of celebration.

“It’s a sad day for all of us and a powerful reminder that there’s still a lot of hatred in the world,” said David Mariner, executive director of the DC Center for the LGBT Community. “Much work remains all around the world. And much work remains right here in the District of Columbia.”

Gunman in Orlando pledged allegiance to ISIS; at least 50 killed in shooting rampage at gay club

Authorities say Omar Mateen, 29, opened fire inside the crowded Pulse nightclub early Sunday, killing 50 people and injuring 53 others in the deadliest mass shooting in U.S. history. During the attack, authorities say, Mateen made a 911 call in which he pledged allegiance to the Islamic State. Mateen, whose family is from Afghanistan, also cited the 2013 bombing of the Boston Marathon.

At D.C. Pride on Sunday, the LGBTQ community expresses sorrow and stands in support with the victims of the deadly mass shooting that took place at a gay nightclub in Orlando, Florida. (Video: Zoeann Murphy/The Washington Post)

President Obama said federal authorities were investigating the attack as an act of terrorism. The ­Islamic State-linked Amaq News Agency said in a message Sunday that the Orlando shooting “was carried out by an Islamic State fighter.”

In statements Sunday, local elected officials expressed heartache upon learning of the attack.

Maryland Gov. Larry Hogan (R) said he reached out to Florida Gov. Rick Scott (R), who has issued a state of emergency, to lend support and assistance. “We offer our most sincere condolences to the family and friends of the innocent victims of this act of terror, and our deepest gratitude to the first responders and law enforcement who responded to this tragedy with bravery and courage,” Hogan said.

Virginia Gov. Terry McAuliffe (D) tweeted: “I’m heartbroken by the news of sons & daughters lost last night in Orlando. Praying for victims, families & an end to senseless gun violence.”

Also on Sunday, authorities in Los Angeles said they arrested a heavily armed man who said he was going to the L.A. Gay Pride festival in West Hollywood. Authorities found possible explosives as well as an assault rifle and ammunition in his car.

Man with ‘weapons and other dangerous material’ wanted to harm gay pride event in Santa Monica, Ca.

In the District, the question that suffused the festivities was how to celebrate the LGBT community’s growing prominence in the national ethos at a moment of violence and uncertainty.

For many, the answer was to celebrate as usual — if not more so — while paying respect to the lives lost. The Gay Men’s Chorus dedicated its festival performance to the victims. A moment of silence punctuated the festival early Sunday afternoon as hundreds of revelers hugged, held hands and hoisted rainbow flags.

Supporters planned several vigils in the region Sunday night, including a “Rally for Peace” at the U.S. Capitol and a candlelight vigil at Dupont Circle — and there was no indication that turnout at the Pride festival was any lower than it would have otherwise been.

‘It was just complete chaos’: Orlando massacre survivors on the desperate struggle to stay alive

“People are not staying away; they are actually coming down here in the show of solidarity,” said Bernie Delia, Capital Pride Alliance board president. He added: “There’s a duality of emotions going on. There’s sadness, there’s anger, but there’s also resolution and people are resolved to go forward.”

He said event organizers heightened security — as did District police. D.C. Mayor Muriel E. Bowser (D) said more police were added to the streets to monitor Sunday’s festival and popular LGBT hangouts.

“This morning, our hearts are heavy after hearing about the tragedy in Orlando. Just yesterday, we held the annual Capital Pride parade, a celebration of the rich diversity and contributions of the LGBTQ community in the District of Columbia,” Bowser said Sunday. “Today, as always, we will not be deterred by hate as we gather to celebrate love.”

That’s why James Dallas Dunn, 28, of Arlington decided to come. Dunn, who served eight years in the Marine Corps, said he talked with his boyfriend Sunday morning about skipping the festival. They weren’t sure it was safe.

But in the end, he said he wouldn’t be cowed by the Florida attack. After he arrived, he said he felt his senses heighten. Another attack could happen anywhere. “I would definitely say my Marine mentality is kicking in — just visually, looking around,” he said.

That fear intensified calls among some managers of gay establishments to institute stronger security at popular community hangouts. The Paris attacks — and now Orlando’s — have exposed the vulnerabilities in crowded and loud social settings.

“That could have been any gay bar, any gay club in any community,” said Brock Thompson, an emcee at Saturday’s Pride parade, walking with friends in Shaw.

After the Paris attacks, David Perruzza, general manager of JR’s Bar, prohibited patrons from bringing bags inside. Given the Orlando massacre, he said he’ll keep that policy in place indefinitely. “This tragedy in Orlando needs to be a wake-up call to all of us,” he said on Facebook. “If you are a bar patron, if you see something, say something.”

On Sunday, two other gay bars, Cobalt and Green Lantern, also prohibited bags. “Given the events in Orlando, and because the safety of our patrons is our top priority, we ask that you leave all bags at home until further notice as no bags will be allowed in the Green Lantern,” the bar said on its Facebook page. “We’re all in this together. Stay safe out there and Happy Pride!”

Muslims in the Washington region said they also were reeling from the attack. Some expressed outrage while privately worrying of the backlash that the attack could bring.

“There have been numerous attacks on mosques around the country, and any time an act [such as in Orlando] happens, that’s always in the back of my mind,” said Rafi Ahmed, an official with Dar ­Al-Noor Mosque in Northern Virginia, who called the gunman ­“demented.”

“We refuse to be represented by him,” Ahmed said. “He does not represent us. And he doesn’t represent our religion. We’re outraged. It was declared a hate crime, and that’s what it is.”

The Ahmadiyya Muslim Community urged calm and offered its condolences to the friends and families of the victims. The Virginia chapter of the community planned to hold a prayer service at the Mubarak Mosque in Chantilly, Va., and said all faiths were welcome.

Randy Shulman, editor of Metro Weekly, a publication that covers gay life in the District, said he’s seen a lot of violence against the community in his 30 years of living an openly gay life — but nothing like this. “I cannot remember a single act of violence against the gay community in any way shape or form like this,” he said.

Those of a younger generation, however, said that they came of age in a time of greater tolerance and said the attack showed how much was left to be done.

“Our generation of the LGBT community has never not seen the progression of acceptance,” Dunn said. “Events like this make us remember how little we’ve really progressed.”

“You want to be happy, but you’re sad about what’s happening down there,” said Kris Archer, 33, of Greenbelt, Md. “You don’t have to look, you don’t have to agree with us, but you don’t have to kill us.”

In Dupont Circle, where the Capital Pride parade thundered through the streets Saturday, others grappled with the difficult questions. Had their movement — which has notched so many victories, from growing prominence on television to the nationwide legalization of same-sex marriage — fomented a violent backlash?

“Gay visibility is going to inevitably make life a little worse for gay people before it gets better,” said Matthew Viator, 31, as he walked down P Street with his mother. “You are going to stir a hornet’s nest of people who really, really wish you don’t exist. And they are going to strike.”

Others refused to dwell on such perceived ramifications. Orlando’s attack should embolden the LGBT community, some people said. “Pride has always been about celebration,” said Mariner of the DC Center for the LGBT Community. “But it’s also about community. And I can’t imagine a day when our community needs to be together more than this day.”