President Barack Obama was briefed about the shooting and asked to receive regular updates, a White House statement said.
Orlando Police Chief John Mina said the attack began at 02:00 (06:00 GMT). There was an exchange of fire with a police officer working at the club, but it is unclear whether that was inside or outside the venue.
After this a "hostage situation" unfolded, he said.
Chief Mina said a decision was taken at 05:00 to send a police assault team into the club after receiving texts and phone calls from some of the hostages.
"Our Swat officers exchanged gunfire with the suspect, the suspect is dead," he said.
"He appeared to be carrying an assault-type rifle and a handgun, and had some type of device on him."
An FBI spokesman said they were investigating whether the attacker was a "lone wolf". He said the attacker appeared to "have leanings towards" radical Islamist ideology but it was not yet clear whether this was a case of domestic or international terrorism.
At least 20 bodies have been found in the club itself, and some 42 people have been taken to hospital to be treated for their injuries, Chief Mina said.
A clubber earlier described a situation of chaos outside as the number of casualties became apparent.
"There were just bodies everywhere," Christopher Hansen said. "In the parking lot, they were tagging them - red, yellow - so they knew who to help first and who not help first. Pants down, shirts cut off, they had to find the bullets. Just blood everywhere."
Some of the injured were reportedly brought to the Orlando Regional Medical Center in police pick-ups.
More than 100 people were reported to have been enjoying the end of a Latin-themed night in the club, which calls itself the hottest gay bar in the city, when the attack began.
"We heard rapid fire go off. In the room I was in, people went down to the floor. I wasn't able to see the shooter or people get hurt," Ricardo Negron Almodovar told the BBC.
"At some point, there was a brief pause, and a group of us got up and went to the exit that leads to the patio area outside. We found an exit and after that... I just ran."
According to the Mass Shooting Tracker, the US last year suffered 372 mass shootings, defined as a single incident that kills or injures four or more people. Some 475 people were killed and 1,870 wounded.
The latest incident came as Orlando was still reeling from the fatal shooting on Friday night of 22-year-old singer Christina Grimmie following a concert in the city.
She had been signing autographs when she was shot by 26-year-old Kevin James Loibl, who then killed himself. It is not clear what Loibl's motive was.