Fifty people have been killed, including the assailant, and at least 53 injured in an attack inside a gay nightclub in the US state of Florida, authorities said, in the worst mass shooting in US history.

Authorities identified the shooter on Sunday as Omar Mateen, a 29-year-old man born in New York with Afghan origins.

Mateen, who was armed with an assault-type rifle and a handgun, was killed in a shootout with at least 11 police officers inside the Pulse nightclub in Orlando.

Ron Hopper, special FBI agent in charge of the Orlando office, confirmed that Mateen was interviewed twice by the agency in 2013, after he made "inflammatory comments" to co-workers alleging possible "terrorist ties".

READ MORE: Who was Omar Mateen?

In 2014, authorities interrogated Mateen anew for possible ties to an American suicide bomber.

In both cases, the FBI closed the investigations as they turned out to be "inconclusive" at that time, Hopper said.

Hopper also confirmed media reports that Mateen made 911 calls to police early on Sunday, and referred to the Islamic State of Iraq and the Levant (ISIL also known as ISIS) group.

'Act of terror and hate'

In a televised statement, President Barack Obama condemned the shooting as "an act of terror and an act of hate", calling the shooter "a person filled with hatred".

"As Americans, we are united in grief and outrage," he said, adding that the attack is "a further reminder of how easy it is for someone to get their hands on a weapon" and commit violence in the US.

Orlando Police chief John Mina described the shooting as "one of the worst tragedies we have seen", adding that police officers "were shaken by what they have seen inside the club".

"It's a tragedy not only for the city but the entire nation," he said. "Just a look into the eyes of our officers told the whole story."

READ MORE: US and world leaders condemn Orlando shooting

The injured, many in critical condition, were transferred to nearby hospitals. Among those injured was one police officer, whose kevlar helmet was hit by a round from the suspect.

The suspect exchanged gunfire with a police officer working at the club, which had more than 300 people inside. The gunman then went back inside and took hostages, Mina said.

Around 5am, authorities sent in a SWAT team to rescue the hostages.

Shooting at Pulse Nightclub on S Orange. Multiple injuries. Stay away from area. pic.twitter.com/5Di2mc6XUY — Orlando Police (@OrlandoPolice) June 12, 2016

While details of the attack were still emerging, Orlando residents gathered outside the nightclub to pay their respects to the victims.

Al Jazeera's Andy Gallacher, reporting from the scene, described a banner laid out in the streets where people dipped their hands in paint and made their mark. Across the top of the banner was written, "Today our hearts cry out in unity".

"Just metres away at the Pulse nightclub, a popular venue for the LGBT community, bodies of the victims are still lying where they fell," our correspondent said. "Many are yet to be identified."

As the shooting occurred, the nightclub urged patrons to "get out" and "keep running" in a post on its Facebook page.

One witness, who said he was inside the building during the incident, said he heard about 40 shots being fired.

Christopher Hansen said he was in the VIP lounge of the club when he heard gunshots. He continued to hear shooting even after he emerged and police urged people to back away from the club. He saw the wounded being tended to across the street.

"I was thinking, 'Are you kidding me?' So I just dropped down. I just said, 'Please, please, please, I want to make it out,'" he said. "And when I did, I saw people shot. I saw blood. You hope and pray you don't get shot."