Two firearms, including a “long rifle”, were found at the scene at Club Q, said Colorado Springs Police Department Chief Adrian Vasquez.
“At least two heroic people” confronted the gunman and stopped the shooting, the chief said, adding: “We owe them a great debt of thanks.”
Authorities received the report of a shooting at Club Q at 11,57pm on Saturday, said Lieutenant Pamela Castro of the Colorado Springs Police Department.
The violence is the sixth mass killing this month and comes in a year when the nation was shaken by the deaths of 21 in a school shooting in Uvalde, Texas.
Ms Castro said the suspect was injured but did not know how and that the FBI was on the scene.
Colorado Springs mayor John Suthers said the attack at Club Q ended when someone grabbed a handgun from the suspect, named as Anderson Lee Aldrich, and hit him with it, before holding him down until police arrived.
The club called the incident a “hate attack”, but investigators are still determining a motive and whether it would be charged as a hate crime.
Attorney General Merrick Garland has been briefed on the shooting, Justice Department spokesman Anthony Coley said.
The FBI said it was providing assistance to Colorado Springs police, but said the police department was leading the investigation.
Colorado Governor Jared Polis, who became the first openly gay man in the United States to be elected governor in 2018, said the news was “sickening”.
“My heart breaks for the family and friends of those lost, injured, and traumatized in this horrific shooting.
“I have spoken with Mayor (John) Suthers and clarified that every state resource is available to local law enforcement in Colorado Springs,” Mr Polis said.
“Colorado stands with our LGTBQ community and everyone impacted by this tragedy as we mourn.”
Although a motive in the shooting was not yet clear, nor were the gender identities of the victims, the incident came as anti-gay rhetoric has intensified by extremists.
In a statement, Club Q termed the shooting a hate attack.
“Club Q is devastated by the senseless attack on our community,” the club posted on its Facebook page.
It said its prayers were with victims and families, adding: “We thank the quick reactions of heroic customers that subdued the gunman and ended this hate attack.”
The shooting came during Transgender Awareness Week and hours before Sunday’s International Transgender Day of Remembrance, when events around the world are held to mourn and commemorate transgender people lost to violence.
The Colorado Springs shooting was sure to bring special resonance to Sunday’s events.
Club Q is a gay and lesbian nightclub that features a Drag Diva Drag Show on Saturdays, according to its website.
In addition to the drag show, Club Q’s Facebook page said planned entertainment included a “punk and alternative show” preceding a birthday dance party, with a Sunday “all ages brunch”.
Colorado Springs is a city of about 480,000 located about 70 miles south of Denver that is home to the US Air Force Academy, as well as Focus On The Family, a prominent evangelical Christian ministry.
In November 2015, three people were killed and eight wounded at a Planned Parenthood clinic in the city when authorities say a man opened fire because he wanted to wage “war” on the clinic because it performed abortions.
The shooting brought back memories of the 2016 massacre at the Pulse gay nightclub in Orlando, Florida, that killed 49 people.
It occurred in a state that has experienced several notorious mass killings, including at Columbine High School in 1999, a cinema in suburban Denver in 2012 and at a Boulder supermarket last year.
Democratic Representative Adam Schiff of California said on Twitter he was “sickened and horrified” by the shooting, adding: “The LGBTQ+ community is once again the target of the most terrible violence.
“And devastating attacks like these will only become more common if we don’t fight back.
“It must stop.”
Representative-elect Eric Sorensen, who is Illinois’ first openly gay congressman, tweeted that “we must use loud voices to stand up against hate.
“Our country must turn down the hateful rhetoric aimed at our LGBTQ community.”
In June, 31 members of the neo-Nazi group Patriot Front were arrested in Coeur d’Alene, Idaho, and charged with conspiracy to riot at a Pride event.
“Experts warned that extremist groups could see anti-gay rhetoric as a call to action.
The previous month, a fundamentalist Idaho pastor told his small Boise congregation that gay, lesbian and transgender people should be executed by the government, which lined up with similar sermons from a Texas fundamentalist pastor.
There have been 523 mass killings since 2006 resulting in 2,727 deaths as of November 19, according to The Associated Press/USA Today database on mass killings in the US.