The US president looked grave on what he said was an especially tragic day for lesbian and gay Americans, following the mass shooting at a haven for the vibrant LGBT community of central Florida.

The FBI identified the gunman as Omar Mateen, 29, a US citizen of Afghan heritage who was born in New York. He was killed when a police Swat team used a Bearcat vehicle to smash their way into the club and rescue 30 hostages early on Sunday morning.

The FBI special agent Ron Hopper told reporters Mateen had called the emergency 911 service before the attack, and spoke in “general to the Islamic State”. Mateen was a known Isis sympathiser, Hopper said, and had been the subject of two previous investigations, closed in 2013 and 2014 respectively.

He was interviewed repeatedly during those years, but the FBI was unable to verify any alleged ties to terrorists.

“He is not a prohibited person, so he can legally walk into a gun dealership,” a representative of the Bureau of Alcohol, Tobacco and Firearms said. “He did so within the last week or so.”

At the White House, where the US flag was lowered to half-mast, Obama said: “Today marks the most deadly shooting in American history.”

The president said the full resources of the government would be used to investigate what he described as a “horrific massacre” and continued: “We are still learning all the facts. This is an open investigation. We’ve reached no definitive judgment on the precise motivations of the killer.

“The FBI is appropriately investigating this as an act of terrorism. And I’ve directed that we must spare no effort to determine what, if any, inspiration or association this killer may have had with terrorist groups. What is clear is that he was a person filled with hatred. Over the coming days we’ll uncover how and why this happens and we’ll go wherever the the facts lead us.”

The president, who had just met with FBI and homeland security officials, said families of the victims were “grasping for answers with broken hearts”, adding: “Although it’s still early in the investigation, we know enough to say that this was an act of terror and an act of hate. And as Americans, we are united in grief, in outrage, and in resolve to defend our people.”

The Kevlar helmet that saved the life of an officer. Photograph: Orlando police/handout/EPA

He described it as “an especially heartbreaking day for all of our friends and fellow Americans who are lesbian, gay, transgender and bisexual”. They had gone to the club “to be with friends, dancing and singing”, he said.

It was the 15th time Obama had addressed the country after a mass shooting. Less visibly emotional than on other occasions, the president made a brief reference to the gun control issue, saying: “This massacre is therefore a further reminder of how easy it is for someone to get their hands on a weapon that allows them to shoot people at a school, or a movie theater, or a church or a nightclub.

“This could have been any one of our communities ... We have to decide whether that’s the kind of country we want to be. To actively do nothing is a decision as well.”

As a stunned nation braced for a full tally of the victims, gay rights campaigners said they were “devastated” by the unprecedented attack on their community, which also left 53 people injured, many critically.

Buddy Dyer, the mayor of Orlando, said: “Today we are dealing with something we never imagined and is unimaginable.”

Hopper, the FBI agent, told a morning press conference the case was being investigated as an act of terrorism. A US official, however, told the Guardian that while an unfolding federal investigation was in the earliest stages, an initial hypothesis regarding the shooter’s motive leaned closer to a hate crime than an act of terrorism.

“The idea of it being terrorism is not off the table, but it’s probably not the principal approach,” said the official, who wished to remain anonymous.

The tragedy happened amid an already febrile election campaign in which the presumptive Republican nominee, Donald Trump, has called for a ban on Muslims entering the country because of fears of terrorism. In a sign of how the political tone could rapidly deteriorate, Trump first tweeted on Sunday: “Appreciate the congrats for being right on radical Islamic terrorism, I don’t want congrats, I want toughness & vigilance. We must be smart!”

Subsequently, Trump did not cite any sources when he tweeted: “Reporting that Orlando killer shouted ‘Allah hu Akbar!’ as he slaughtered clubgoers.”

The presumptive Republican nominee later issued a statement in which he called for Obama to “step down”, because he “disgracefully refused to even say the words ‘Radical Islam’”, and added: “If Hillary Clinton, after this attack, still cannot say the two words ‘Radical Islam’ she should get out of this race for the presidency.”

Clinton, the former secretary of state, was more circumspect. “I join Americans in praying for the victims of the attack in Orlando, their families and the first responders who did everything they could to save lives,” she said in a statement posted to Facebook.

Clinton did, however, call the attack “an act of terror”, adding: “We will learn more in the hours and days ahead. For now, we can say for certain that we need to redouble our efforts to defend our country from threats at home and abroad.”

Clinton also called the attack “an act of hate” against the LGBT community.

After police said the shooter had an “AR-15-type assault rifle” and a handgun, the shooting also stoked the debate over gun control. Obama has long and sometimes tearfully expressed his frustrations at trying to push reforms through Congress. He has described the 2012 shooting of 20 children and six adults at Sandy Hook school in Newtown, Connecticut, as the worst day of his presidency.

In her statement, Clinton said: “We need to keep guns like the ones used last night out of the hands of terrorists or other violent criminals. This is the deadliest mass shooting in the history of the United States and it reminds us once more that weapons of war have no place on our streets.”

NBC News said it had contacted Mateen’s father, Mir Seddique, who said: “We are saying we are apologising for the whole incident. We weren’t aware of any action he is taking. We are in shock like the whole country. This had nothing to do with religion.”

NBC News also reported Mateen’s father as saying his son reacted angrily a couple of months ago when he saw two men kissing in Miami. The Washington Post reported Mateen’s ex-wife said he was violent and mentally unstable and beat her repeatedly while they were married.

“He was not a stable person,” the newspaper’s website quoted her as saying. “He beat me. He would just come home and start beating me up because the laundry wasn’t finished or something like that.”

‘Everyone get out of Pulse and keep running’

America’s worst mass shooting unfolded over three terrifying hours at the Pulse nightclub, which was celebrating Latin Night. A drag queen from Puerto Rico was scheduled to perform, after Orlando’s 25th Gay Days festival. The shooting began at about 2am. Anthony Torres was about to leave. “It seemed fake,” he later wrote on social media. “This had to be planned.”

Torres wrote that he saw people “screaming and running, looking for their loved ones” and saw other “injured people sitting on the floor”. He and his boyfriend, sister and friends ducked out the door.

A police officer outside the club moved to confront the gunman, the Orlando police chief, John Mina, told reporters on Sunday. The officer drew the gunman outside on to Orange Avenue, where they exchanged fire. Then the shooter re-entered the club and started firing again.

A survivor, Christopher Hansen, mistook the first sounds of discharge to be part of the DJ’s set. “You think you hear a song, it’s music, and then you realize no, it’s not, it’s real life, there’s somebody actually shooting,” he told a reporter outside the club. “It’s not OK. It’s not.”

He added that he knew the gunman must have had more than a handgun: there were too many shots. He fired dozens of rounds.

Staff at Pulse posted on Facebook: “Everyone get out of pulse and keep running.”

Outside, more than 100 personnel congregated, including officers from departments and agencies around central Florida, Swat teams, FBI agents and a bomb squad with dogs.

Inside, people scattered. Some hid in bathrooms. A local station, WFTV, broadcast several texts to family members. A mother recounted a text from her daughter and two nieces: “‘Please come and get us. Please come and get us now. They’re shooting. They’re shooting.’”

“He’s coming,” a man wrote in another. “He’s in the bathroom with us.”

A social media photo believed to show Omar Mateen. Photograph: MySpace

Eventually, the police made contact with the gunman, who had taken hostages. Mina declined to describe those talks on Sunday morning. The standoff lasted for hours. A mother, Mina Justice, said her son texted her.

“He said: ‘He has us, and he’s going to kill us,’ and that was it.”

Another mother, Lilbia Carmen, appealed for news on Facebook.

“Nothing yet. My daughter is in there. Please keep praying for them,” she wrote. “She’s waiting for cops to be able to come out. I was on the [phone] and all I hear is shot guns.”

Carmen’s daughter escaped the carnage. The children of dozens of other parents did not.

At about 5am the police and FBI decided they could not wait any longer. “Our biggest concern was further loss of life,” Mina later told reporters.

Two loud explosions startled the press and survivors still within earshot of the club – two controlled blasts “to distract the suspect and gain that advantage”, Mina said. Then an armoured Bearcat truck smashed through a bathroom wall to free people while nine officers stormed the building, beginning a new battle with the shooter.

The gunman struck one of the officers with a bullet, but the man was saved by his Kevlar helmet, Mina said. The shooter was shot dead and about 30 people were rescued.

In addition to the weapons, police found a suspicious device on the suspect’s body. A bomb-defusing robot rolled inside, and they found the object was not explosive.

But the death toll surpassed authorities’ worst fears. They had estimated about 20 people killed at an initial briefing. After entering the club, they found 30 more bodies, 50 in all, and many more in dire condition, marking a death toll without precedent.

Later on Sunday, a 27-year-old man, who did not want to be named, showed reporters a bloody scratch across his stomach where he said a bullet had grazed him. The man said he had been standing at the bar, paying his bill, when the shooting started. He was carried across the bar by the weight of others rushing to escape, he said, and ended up underneath a pile of people.

When he was able to look up, he said, he saw about 20 bodies apparently dead or badly wounded on the floor around him.

Later, at police headquarters, people waited for news of loved ones. Brian Vieoma had been texting and calling his brother Luis’ cellphone since his family learned about the shooting. He had no reply and now feared the worst.

“He came over for Latin Night. Venezuelans love to go dancing,” Vieoma said of his 22-year-old brother.

Dyer declared a state of emergency, and alongside Mina, Hopper and a local imam urged Americans to give blood and unite. He told WESH-TV: “It’s a tragedy of unimaginable proportions. My heart goes out to the victims, their families. But we’re a strong, resilient community.”

Queer Muslims exist – and we are in mourning too

Read more

Dyer, who has been mayor of Orlando for 14 years, said he had “never seen anything like this. I hope no mayor ever has to see anything like this”.

Michael Cheatham, a surgeon with Orlando Health, told the press briefing local hospitals had implemented a “mass casualty plan” and spent the morning operating on a number of victims, “many of them critically ill as a result of their injuries”. Blood banks in the Orlando area were straining under the effort to take in donors, the Orlando Sentinel reported, as hundreds come out to give for the victims.

The mayhem came in the month that Americans celebrate gay pride. Chad Griffin, president of the Human Rights Campaign – the country’s biggest LGBT rights organisation – said: “We are devastated by this tragic act of violence, which has reportedly claimed the lives of at least 50 LGBTQ people and allies and injured more than 50 others.

“We are grieving for the victims and our hearts are broken for their friends, families, and for the entire community. This tragedy has occurred as our community celebrates pride, and now more than ever we must come together as a nation to affirm that love conquers hate.”