At least five people have been killed and 18 injured after a gunman opened fire inside a gay club in the US state of Colorado on Saturday night.
A suspect is in police custody and is being treated for injuries. Two "heroic" people in the club subdued the attacker, police say.
Club Q, in Colorado Springs, wrote on Facebook that it was "devastated by the senseless attack" on its community.
US President Joe Biden said Americans "cannot and must not tolerate hate".
Police asked people to be patient while they worked to identify victims and finalise the number of casualties, adding that some people had taken themselves to hospital.
Officers received an initial emergency call about an active shooter at 23:57 (06:57 GMT) on Saturday, they said.
The suspect was found inside the club. Two firearms were found at the scene, and the attacker is thought to have used a long rifle.
Police did not suggest a motive for the shooting but said the investigation would consider whether it was a hate crime, and if more than one person was involved.
A fire department spokesman said casualties had been transported to hospitals very quickly because of training for such events.
The FBI in nearby Denver said it was assisting local police with the incident.
Police chief Adrian Vasquez thanked the two club-goers who intervened to stop the shooter.
"Initial evidence and interviews indicate that the suspect entered Club Q and immediately began shooting at people inside as he moved further into the club," he told a news conference on Sunday.
"While the suspect was inside of the club, at least two heroic people inside the club confronted and fought with the suspect and were able to stop the suspect from continuing to kill and harm others. We owe them a great debt of thanks."
A statement on the Club Q Facebook page thanked "the quick reactions of heroic customers that subdued the gunman and ended this hate attack".
The club was hosting a dance party at the time, and had planned to hold a performance event on Sunday evening to celebrate Transgender Day of Remembrance.
Joshua Thurman, 34, was in the club at the time of the shooting.
At first he thought the shots were part of the music, he told the Colorado Sun, but he later ran to take shelter in the club dressing room.
"When I came out there were bodies on the floor, shattered glass, broken cups, people crying," he said.
"There was nothing keeping that man from coming in to kill us. Why did this have to happen? Why? Why did people have to lose their lives?"
Mr Thurman, who lives near the club, said it was an important part of the local gay community. He believes he knows one person who was killed.
Colorado Springs mayor John Soothers called the event a tragedy.
"We are a strong community that has shown resilience in the face of hate and violence in the past, and we will do that again," he said.
The suspect in custody was named as Anderson Lee Aldrich, 22.
In 2015, three people were killed and nine injured in a shooting at a Planned Parenthood Clinic in Colorado Springs.
The state of Colorado has seen other mass shootings, including at a supermarket in Boulder in 2021 in which ten people were killed.
Governor of Colorado Jared Polis, who is gay, praised the "brave individuals who blocked the gunman, likely saving lives in the process".
"Colorado stands with our LGTBQ Community and everyone impacted by this tragedy as we mourn," he wrote in a Facebook post.
In a statement from the White House, President Biden said: "Places that are supposed to be safe spaces of acceptance and celebration should never be turned into places of terror and violence. Yet it happens far too often. We must drive out the inequities that contribute to violence against LGBTQI+ people."
Club Q's Facebook page has been inundated with comments and condolences from around the world.
One person wrote that the club had been "like a home" for her for many years, and she was "absolutely shattered" by the news.
"[I] met so many great people, I literally met my husband there, so it holds such a special place in my heart. Everyone was always so welcoming and kind through the years," she wrote.
"I am so broken by this news," another comment added.
"Club Q has been the heart of our community for so long and I am devastated and angered that this happened."
In 2016, 49 people were killed and more than 50 injured in a shooting at the Pulse gay club in Orlando, Florida. At the time it was the deadliest mass shooting in US history.