In a mass shooting at the Pulse nightclub in Orlando early Sunday, 51 people were killed and more than 50 others were injured. Officials say the suspected gunman, Omar S. Mateen, had pledged allegiance to Islamic State. Photo: Orlando Sentinel

FIFTY people are now known to have died in a shooting in a gay nightclub in Orlando, Florida, and a state of emergency has been declared, the city’s mayor Buddy Dyer has said.

The gunman, named by officials as Omar Mateen, was killed after taking hostages.

Another 53 people were injured in the shooting at the Pulse club.

It is the worst mass shooting in recent US history. US President Barack Obama has called the shooting a “horrific massacre” and an act of terrorism and hate. “And as Americans, we are united in grief and in outrage, and in resolve to defend our people.”

Florida governor Rick Scott said it was “clearly an act of terror”.

The gunman opened fire at Pulse nightclub with a handgun and an “AR-15” assault rifle about 2am Sunday (4pm Sunday AEST) before taking about 100 partygoers hostage.

Three hours later, SWAT teams stormed the club and exchanged gunfire with the attacker to rescue the hostages.

Police confirmed “every source in the FBI would be brought to bear”, as they would be investigating the shooting as an act of terrorism. It is not clear if it was a homophobic or Islamist attack.

However, ISIS has claimed the attack as one of their own. The IS-linked news agency Amaq says that the shooter was an IS fighter, quoting an unidentifed source: “The attack that targeted a nightclub for homosexuals in Orlando, Florida and that left more than 100 dead and wounded was carried out by an Islamic State fighter.”

The mass shooting happened about six kilometres from whereThe Voice singer Christina Grimmie, 22, was shot dead on Friday.

At 5am local time, a SWAT team made the call to rescue the hostages inside the club. Officers stormed the building and used an explosive device to distract the gunman.

Chief Mina said that there was communication with the gunman during the hostage situation, but did not give details. The gunman reportedly identified himself. Moments before he opened fire, he called 911 and declared his allegiance to ISIS, reports NBC News. He also made reference to the Boston Bombers.

“Just based on what the initial officers saw, they thought at least 20 (were killed). Now we know it is more,” he said.

“There was an initial shooting at 2am, and then gunfire exchanged between the SWAT team and the gunman.”

The popular gay dance club issued a Facebook status update, saying: “Everyone get out of pulse and keep running” after the shooting first occurred.

Police are searching the gunman’s home for any more devices and clues. He has been described as “organised” and “well-prepared”.

CBS News reported that Mateen — who died in a shootout with police after the hostage siege — has no apparent criminal history and that authorities are investigating whether he had ties to Islamic extremism.

US Congressman Pete King told CNN that Mateen was “trained in the use of weapons”.

Jon Alamo said he was at the back of one of the club’s rooms when a man holding a weapon came into the front of the room.

“I heard 20, 40, 50 shots,” Alamo said. “The music stopped.” Club-goer Rob Rick said it happened around, 2am, just before closing time.

“Everybody was drinking their last sip,” he said.

Another statement from a person who was at the club when the shots began pic.twitter.com/ODGAZ3L2HD — Stewart Moore (@Stewartmoore) June 12, 2016

He estimated more than 100 people were still inside when he heard shots, got on the ground and crawled toward a DJ booth.

A bouncer knocked down a partition between the club area and an area in the back where only workers are allowed. People inside were able to then escape through the back of the club.

Mina Justice was outside the club trying to contact her 30-year-old son Eddie, who texted her when the shooting happened and asked her to call police. He told her he ran into a bathroom with other club patrons to hide. He then texted her: “He’s coming.”

She said the next text said: “He has us, and he’s in here with us.”

“That was the last conversation,” she added.

#Breaking #Orlando Witness just told me his friend is locked inside a bathroom with a gunshot wound. — Stewart Moore (@Stewartmoore) June 12, 2016

#Breaking Bomb dogs and crews are walking the grounds near ORMC pic.twitter.com/KyOHH7wpba — Stewart Moore (@Stewartmoore) June 12, 2016

Multiple emergency vehicles including the Orlando Fire Department’s bomb squad and hazardous material team went to the scene. Local streets were cordoned off.

Members of the public have been told to stay away from the area by Orlando Police.

Speaking to Sky News, clubber Ricardo Negron, who was inside when the shooting began, described how the gunman raked the club with bullets.

“At around 2am someone started shooting. People just dropped on the floor. I guess the shooter was shooting at the ceiling because you could see all the glass from the lamps falling,” he told the network.

He described hearing “non-stop firing” which probably lasted less than a minute but felt like a lot longer.

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

“There was a brief pause in the shooting and some of us just got up and ran out the back. People have definitely been injured — or worse.”

It was not immediately clear how many people were inside the club when the shooting began.

Another clubber called Christopher Hanson told CNN he heard “loud banging noises, like gunshots going off.”

He said at first he thought it may have been the music “until you heard too many shots. It was like, bang, bang, bang, bang.”

“I didn’t see any of the actual shooters. I just saw bodies going down,” he told CNN, saying he was ordering a drink at the bar at the time.

“I fell down. I crawled out. People were trying to escape out the back. I just know that when I hit the ground, I was crawling and I hit my elbows and my knees. When I got across the street, there were people — blood everywhere,” he said.

Those who were inside or near the nightclub have described their shock and posted videos of the crime scene on social media.

President Barack Obama was being kept up to date by his homeland security and counterterrorism aide on what Florida officials said was being investigated as a terrorist attack. The federal government has offered its full support with the probe.

The attack coincides with gay pride month in the US, with festive marches and events being held all over the country including in Orlando last week.

Local resident weeping looking down the block towards #PulseNightclub. Another update on investigation soon. @WESH pic.twitter.com/FF60h0teCK — bob kealing (@bobkealingwesh) June 12, 2016

The incident came just two days after a deadly shooting at the nearby Plaza Live Theatre in which a heavily-armed gunman shot and critically wounded singer Christina Grimmie, a former contestant on the popular TV talent show The Voice. She was rushed to hospital but died of her wounds.

Orlando Police said the shooting death of Ms Grimmie was not linked to the shooting at Pulse nightclub.