Washington/ORLANDO - Fifty people died in the worst mass shooting in US history Sunday when a suspected Islamist gunman opened fire inside a gay nightclub in Orlando, Florida.

Scenes of carnage unfolded at the packed venue where another 53 people were injured, some critically.

"We know enough to say that this was an act of terror and an act of hate," President Barack Obama said. "The FBI is appropriately investigating this as an act of terrorism."

Officials were probing whether the suspect, widely identified as 29-year-old Omar Mateen, a US citizen of Afghan descent, had radical Islamic "leanings".

US networks CNN and NBC, citing law enforcement sources, said the gunman called police before the shooting to pledge allegiance to the Islamic State group. But the father of the suspect said his son may have been motivated by homophobia.

And the suspect's ex-wife, who divorced him in 2011, told the Washington Post he had been violently abusive to her but was not especially religious.

"This had nothing to do with religion," father Mir Seddique told NBC News, recalling a recent incident in downtown Miami. "He saw two men kissing each other in front of his wife and kid and he got very angry," the father said, apologising to the victims.

Terrified survivors described how the gunman raked the club with bullets, prompting a police SWAT team to storm the venue and shoot him dead. Mayor Buddy Dyer told a mid-morning news briefing in Orlando that 50 people had been killed in addition to the shooter, more than doubling the previous toll.

"There are another 53 that are hospitalised," he added. Officials said many of the victims are in critical condition, so the death toll could yet rise.

Omar Mateen was born to Afghan parents in 1986 and lives in Port St Lucie, Florida, about two hours drive from Orlando. FBI official Ronald Hopper said authorities were looking into whether the suspect had "leanings" toward religious extremism.

Congressman Michael McCaul, chairman of the House Homeland Security Committee, dubbed the murders "the worst terrorist attack on American soil since 9/11."

The latest mass shooting comes at the height of what is already a heated US presidential election campaign, and the main candidates were quick to react.

Democratic flag-bearer Hillary Clinton tweeted that the attack was "devastating" news and that her "thoughts are with those affected by this horrific act."

Her Republican rival Donald Trump, who has called for Muslims to be banned from travelling to the United States, tweeted: "When will this stop?"

"When will we get tough, smart and vigilant?" he demanded, later boasting of having been "right on radical Islamic terrorism."

Events unfolded over a three hour period from at around 2:00 am (0600 GMT) when shots rang out amid the throbbing music at the Pulse Orlando club near closing time. Police said the suspect was armed with an assault rifle and a handgun. A police officer working "extra duties" at the club responded, joined by two other officers, who exchanged fire with the suspect.

"The suspect at some point went back inside the club where more shots were fired," police chief John Mina said. "At approximately 0500 hours this morning, the decision was made to rescue hostages that were in there."

Police then stormed the venue, using explosives and breaking through a wall with a wheeled armored vehicle known as a BearCat.

Mina said about 30 people were rescued during the operation and that the police priority now would be to identify the victims and notify next of kin. It was unclear whether all the victims were killed by the gunman or if some died in the ensuing shootout.

Ex-wife of the Orlando shooter has alleged her former husband was violent and mentally unstable. According to the woman, who wishes to remain unnamed, Mateen used to beat her repeatedly over petty issues when they were living together.

She had met him online about eight years ago, following which she moved to Florida. In the beginning, the marriage seemed fine but soon afterwards, Omar became abusive. “He was not a stable person. He beat me. He would just come home and start beating me up because the laundry wasn’t finished or something like that.”

Omar’s ex-wife shared his family hailed from Afghanistan; however, her ex-husband was born in New York from where the family moved to Florida.

Omar had uploaded a series of photos on Myspace, wearing New York Police Department shirts and that was where his wife identified him. Her marriage came at a time when, according to her, she was going through difficult time. She married Omar in March 2009 and moved to a two-bedroom condominium in Fort Pierce.

To his wife, Omar appeared to be normal, not a very religious guy who often worked out at the gym. Although he owned a small-caliber handgun as he worked as a guard at a facility for juvenile delinquents, Mateen showed no sign of falling under the sway of extremism.

The ex-wife said her parents intervened when they learned Mateen had assaulted her. According to Florida court records, the two formally divorced in 2011.