Police say an officer working as a security guard inside the Pulse nightclub exchanged fire with the suspect at about 2am local time (7am UK time), before a hostage situation developed, a team of officers entered the club and shot dead the gunman.

Police identified the attacker as Omar Mateen, a 29-year-old from Port St. Lucie, Florida – more than 100 miles away from Pulse. His family is from Afghanistan, while Mateen is believed to have been born in the United States.

Mr Mateen, who is said by the FBI to have "leanings" towards extremism and Islamic State, was involved with a stand-off with officers for around three hours before SWAT teams stormed the building and shot him dead.

Latest footage of Orlando nightclub shooting

It already ranks as one of the deadliest shootings in American history, with a larger death toll than the attacks in San Bernardino, California last December.

It was unclear when the victims were shot by the gunman.

Orlando Police Chief John Mina told a press conference: "At... 0500 hours this morning, the decision was made to rescue hostages that were in there. Our officers exchanged gunfire with the suspect. The suspect is dead,"

There were approximately 320 people in the club when the shooting began. At least one officer was injured in the gun fight but the police action saved at least 30 lives, Mr Mina said.

Loading....

Witnesses in the club posted messages on social media as the stand-off took place, while one reportedly texted his mother to say: "He's rounded us up and he is going to kill us."

A message posted on Pulse's Facebook page read: "Everyone get out of pulse and keep running"

Police say the suspect was carrying an assault-type rifle and a handgun as well as an unidentified "device" on him.

In pictures: Orlando nightclub shooting Show all 30 1 /30 In pictures: Orlando nightclub shooting In pictures: Orlando nightclub shooting Friends and family grieve after a list of hospitalised victims was released, implying the death of those who weren't on the list and hadn't been heard from, outside a Hampton Inn & Suites hotel near the Orlando Regional Medical Center AP In pictures: Orlando nightclub shooting People mourning for victims of the mass shooting near the Pulse gay nightclub in Orlando AFP/Getty Images In pictures: Orlando nightclub shooting Mina Justice speaks to a reporter discussing texting with her son Eddie who was in a bathroom at Club Pulse in Orlando. It has now been confirmed that Eddie Justice was among the 50 people killed in the massacre AP In pictures: Orlando nightclub shooting FBI agents investigate near the damaged rear wall of the Pulse Nightclub Getty Images In pictures: Orlando nightclub shooting Terry DeCarlo, executive director of the LGBT Center of Central Florida (C) is comforted by Orlando City Commissioner Patty Sheehan (R) after a shooting involving multiple fatalities at a nightclub in Orlando AP In pictures: Orlando nightclub shooting FBI agents investigate the damaged rear wall of the Pulse Nightclub Getty Images In pictures: Orlando nightclub shooting Police officials investigate the back of the Pulse nightclub after a shooting involving multiple fatalities at the nightclub in Orlando AP In pictures: Orlando nightclub shooting A member of the Medical Examiners office wheels a body to a vehicle from the mass shooting at Pulse Nightclub Getty Images In pictures: Orlando nightclub shooting A photograph posted by the Orlando Police Department on Twitter with the words, "Pulse shooting: In hail of gunfire in which suspect was killed, OPD officer was hit. Kevlar helmet saved his life", in reference to the operation against a gun man inside Pulse night club in Orlando REUTERS In pictures: Orlando nightclub shooting FBI, Orlando Police Department and the Orange County Sheriff's Office personnel investigate the attack at the Pulse nightclub in Orlando AP In pictures: Orlando nightclub shooting Annette Stubbs, a pastor at a local church, prays for victims a few blocks from a crime scene at the nightclub where a mass shooting took place AP In pictures: Orlando nightclub shooting Aimee McCarthy from Jacksonville, gives blood at the oneblood facility, to help the victims from a mass shooting at a nightclub in Orlando AP In pictures: Orlando nightclub shooting Police forensics investigators work at the crime scene of a mass shooting at the Pulse gay night club in Orlando REUTERS In pictures: Orlando nightclub shooting An injured person is escorted out of the Pulse nightclub after a shooting rampage AP In pictures: Orlando nightclub shooting An injured man is escorted out of the Pulse nightclub after a shooting rampage AP In pictures: Orlando nightclub shooting An injured man is escorted out of the Pulse nightclub after a shooting rampage AP In pictures: Orlando nightclub shooting Law enforcement officials work at the Pulse nightclub following a fatal shooting AP In pictures: Orlando nightclub shooting Orlando Police officers direct family members away from the nightclub AP In pictures: Orlando nightclub shooting The scene outside the Orlando gay club where multiple people have been shot AFP/Getty Images In pictures: Orlando nightclub shooting The injured are treated in the street outside Pulse in Orlando following the shooting EPA/Univision In pictures: Orlando nightclub shooting Two witnesses, Jermain Towns (left) and Brandon Shuford, wait down the street for news following shooting and hostage stand-off at the Pulse nightclub. Mr Towns said his brother was in the club at the time AP In pictures: Orlando nightclub shooting Emergency services at the scene. Ambulance crews and firefighters were outside the club alongside police. EPA In pictures: Orlando nightclub shooting People treating the wounded on the street EPA In pictures: Orlando nightclub shooting Friends and family members embrace outside the Orlando Police Headquarters during the investigation of a shooting at the Pulse night club Reuters In pictures: Orlando nightclub shooting Law enforcement agencies and local city representatives give a news conference in the wake of a mass-casualty shooting at the Pulse nightclub in Orlando Rex In pictures: Orlando nightclub shooting Orlando police officers seen outside of Pulse nightclub after a fatal shooting and hostage situation in Orlando, Florida Getty In pictures: Orlando nightclub shooting Friends and family console one another outside the Orlando Police Headquarters In pictures: Orlando nightclub shooting U.S. President Barack Obama speaks about the worst mass shooting in U.S. history that took place in Orlando REUTERS In pictures: Orlando nightclub shooting Imam Syed Shafeeq Rahman, the Imam of the mosqe that mass shooter Omar Mateen attended, speaks to the media in Fort Pierce. The imam said that the suspect never gave any indication he was capable of such violence.Omar Mateen attended evening prayers three or four times a week at the Islamic Center of Fort Pierce, bringing his son who is about four or five years old AFP/Getty Images In pictures: Orlando nightclub shooting Omar Mateen has killed 50 people at a gay nightclub after pledging allegiance to Isis in the deadliest mass shooting in US history Myspace

Police did not immediately name the gunman or provide a possible motive for the attack but officials have classified the rampage as a "domestic terrorism incident", Orange County Sheriff Jerry Demings said.

Javer Antonetti, 53, told the Orlando Sentinel newspaper he was near the back of the dance club when he heard gunfire. "There were so many (shots), at least 40," he said.

"I saw two guys and it was constant, like 'pow, pow, pow,'."

Medics wait with stretchers at the emergency entrance to Orlando Regional Medical Center hospital (AP)

Police said they had carried out a "controlled explosion" at the club hours after the shooting broke out, but did not explain why that was done.

Orlando sheriff Jerry Demings called the shooting “a domestic terror incident”.

The FBI said they were investigating whether the suspect acted as “a lone wolf” or had any ties to terror groups abroad: “At this time we’re looking into all angles. We do have suggestions that that individual may have had leanings toward that, that particular ideology. But right now we can’t say anything definitively.”

. @orlandomayor Our community is strong. We will need to help each other's get through this. pic.twitter.com/XyUa8g5PT8 — Orlando Police (@OrlandoPolice) June 12, 2016

Orland mayor, Buddy Dyer, said in a statement: "We are strong, resiliant community. And tonight we had a crime that will have a lasting effect on our community. We need to stand strong and we need to be supportive of the victims are their families."

One witness told Sky News there had been more than 100 people inside the venue for the club’s Latin night when the gunman entered the building and began firing into the ceiling and into the crowd.

Richard Negroni said: “We just heard shots, it was less than a minute, it felt longer. There was a brief pause and we just ran. Everybody was just faces to the floor. I had someone over me, I really didn’t see [how many gunmen there were]. All I can tell you was the club was packed, there were over 100 people there, if the gunman came in through the front door people were injured or worse.”

One officer was shot in the head but his Kevlar helmet saved his life.

A mother has told how her son texted her from the club toilets where he was hiding, telling her "I'm gonna die" and "Mommy I love you" before a final text saying: "He's coming."

The aftermath of the shooting involving multiple fatalities at Pulse Orlando nightclub (AP)

Terry DeCarlo from the GLBT Community Center of Orlando said they will be providing counselling, in person or by phone, to those affected by the night’s events.

In an interview with local television station Wesh, he said: “How can you not say that this was an attack on the LGBT community when it’s done in an LGBT club and a shooter walks in and there are 20 of your community members lying in a club and another 40 lying on hospital gurneys.”

President Barack Obama's office said in a statement: “The President was briefed this morning by Lisa Monaco, Assistant to the President for Homeland Security and Counterterrorism, on the tragic shooting in Orlando, Florida. Our thoughts and prayers are with the families and loved ones of the victims.

"The President asked to receive regular updates as the FBI, and other federal officials, work with the Orlando Police to gather more information, and directed that the federal government provide any assistance necessary to pursue the investigation and support the community.”

Rick Scott, Florida's governor, described the events as a "horrific tragedy". In a statement, he said: "We are a strong and resilient state and we will devote every resource available to assist with the shooting in Orlando. Our state emergency operations center is also monitoring this tragic incident. I have been in constant communication with Orlando Mayor Buddy Dyer, Orange County Mayor Teresa Jacobs and state and local law enforcement this morning. I would like to also thank all the first responders who quickly came to assist and help those in need."

The attack comes just days singer Christina Grimmie was shot dead while signing autographs at a concert venue in Orlando