“Heroic people” confronted a gunman at a gay nightclub in Colorado and stopped him killing any more people, police have said.
Five people died and at least 18 were injured at Club Q in Colorado Springs.
The suspect has been named as 22-year-old Anderson Lee Aldrich.
In a news conference, officers said the gunman used a “long rifle” and began shooting as soon as he entered the venue.
Club Q called the shooting a “hate attack” and also said customers overpowered the gunman.
It said: “Club Q is devastated by the senseless attack on our community.
“Our prayers and thoughts are with all the victims and their families and friends. We thank the quick reactions of heroic customers that subdued the gunman and ended this hate attack.”
The initial phone call reporting the active shooting came in at 11.57pm local time, Colorado Springs police lieutenant Pamela Castro told a news conference.
Eleven ambulances and 34 firefighters attended the scene, with the incident described as “a mass casualty event”.
Lt Castro said officers were able to immediately enter the venue, and located one individual they believe to be the suspect.
They are now in custody and being treated for injuries at a local hospital.
She declined to say what kind of firearm was used in the shooting.
Police have not said how the suspect was stopped, or the motivation for the attack.
The area around the nightclub, which is located in a shopping centre on the outskirts of Colorado Springs, has now been closed off.
The FBI are on the scene and assisting with investigations.
Club Q describes itself as an “adult-oriented gay and lesbian nightclub hosting theme nights”, with events including karaoke, drag shows and DJ sets.
A DJ set and dancing was listed as taking place from 9pm local time on Saturday night, following karaoke, and had been due to carry on until 2am.
In 2016, a gunman opened fire in a gay nightclub in Orlando, Florida, killing 49 people before he was shot dead by police. Over 50 others were also injured.
Treated as an act of terrorism, the shooter Omar Mateen, 29, had claimed allegiance to Islamic State.
At the time it was the worst mass shooting in recent US history.