Thirty-nine of the dead were killed at the club, and 11 people died at hospitals, Mayor Buddy Dyer said. The gunman was included in the deaths.
Jon Alamo had been dancing at the Pulse for hours when he wandered into the club's main room just in time to see the gunman. "You ever seen how Marine guys hold big weapons, shooting from left to right? That's how he was shooting at people," he said.
"My first thought was, oh my God, I'm going to die," Alamo said. "I was praying to God that I would live to see another day."
Pulse patron Eddie Justice texted his mother, Mina: "Mommy I love you. In club they shooting." About 30 minutes later, hiding in a bathroom, he texted her: "He's coming. I'm gonna die." As Sunday wore on, she awaited word on his fate.
At least 53 people were hospitalized, most in critical condition, and a surgeon at Orlando Regional Medical Center said the death toll was likely to climb.
The previous deadliest mass shooting in the U.S. was the 2007 attack at Virginia Tech, where a student killed 32 people before killing himself.
Mateen's family was from Afghanistan, and he was born in New York. His family later moved to Florida, authorities said.
His ex-wife, Sitora Yusufiy, told reporters that her former husband was bipolar and "mentally unstable."
The couple was together for only four months, she said in remarks televised from Boulder, Colorado, and the two had no contact for the last seven or eight years.
Mateen was short-tempered and had a history with steroids, she said. She described him as religious but not radical. He wanted to be a police officer and applied to a police academy, but she had no details.
A law enforcement official said the gunman made a 911 call from the club in which he professed allegiance to the leader of the Islamic State, Abu Bakr al-Baghdadi. The official was familiar with the investigation, but was not authorized to discuss the matter publicly and spoke on condition of anonymity.
The extremist group did not officially claim responsibility for the attack, but the IS-run Aamaq news agency cited an unnamed source as saying the attack was carried out by an Islamic State fighter.
Even if the attacker supported IS, it was unclear whether the group planned or knew of the attack beforehand.
Mateen was not unknown to law enforcement: In 2013, he made inflammatory comments to co-workers and was interviewed twice, according to FBI agent Ronald Hopper, who called the interviews inconclusive. In 2014, Hopper said, officials found that Mateen had ties to an American suicide bomber, but the agent described the contact as minimal, saying it did not constitute a threat at the time.
Asked if the gunman had a connection to radical Islamic terrorism, Hopper said authorities had "suggestions that individual has leanings towards that."
Mateen purchased at least two firearms legally within the last week or so, according to Trevor Velinor of the Bureau of Alcohol, Tobacco and Firearms.
In a separate incident, an Indiana man armed with three assault rifles and chemicals used to make explosives was arrested Sunday in Southern California and told police he wanted to do harm to a gay pride parade.
The Orlando shooting started about 2 a.m., with more than 300 people inside the Pulse.
"He had an automatic rifle, so nobody stood a chance," said Jackie Smith, who saw two friends next to her get shot. "I just tried to get out of there."
At 2:09 a.m., Pulse posted on its Facebook page: "Everyone get out of Pulse and keep running."
Club-goer Rob Rick said the shooting started just as "everybody was drinking their last sip."
When he heard shots, Rick dropped to the ground and crawled toward a DJ booth. A bouncer knocked down a partition between the club area and an area where only workers were allowed. People were then able to escape through the back of the club.
Mateen exchanged gunfire with 14 police officers at the club, and took hostages at one point. In addition to the assault rifle, the shooter also had a handgun and some sort of "suspicious device," the police chief said. About 5 a.m., authorities sent in a SWAT team to rescue the remaining club-goers, Police Chief John Mina said.