A gunman killed 50 people at a packed gay nightclub in Orlando, Florida on Sunday and wounded 53 others before being killed by police in the worst mass shooting in U.S. history.

The shooter was identified as Omar S. Mateen, a Florida resident who a senior FBI official said might have had leanings toward Islamic State militants. Officials called the rampage a “terrorism incident,” but cautioned that the suspected Islamist connection required further investigation.

Orlando Mayor Buddy Dyer said the attack was the deadliest single U.S. shooting incident, eclipsing the 32 people killed in the 2007 massacre at Virginia Tech university.

“Today we’re dealing with something that we never imagined and is unimaginable,” Dyer said, more than doubling an earlier estimate that about 20 bodies were found in the Pulse nightclub.

A police officer working as a security guard inside the club, which has operated in downtown Orlando since 2004, exchanged fire with the suspect at about 2 a.m. EDT, police officials said.

A hostage situation quickly developed, and three hours later SWAT team officers used armored cars to storm the club before shooting dead the gunman. It was unclear when the gunman killed the victims.

One officer was injured after he was hit in his helmet while exchanging fire with the gunman, police said.

“Do we consider this an act of terrorism? Absolutely,” said Danny Banks, special agent in charge of the Florida Department of Law Enforcement. “Whether that is domestic terrorist activity or an international one, that is something we will certainly get to the bottom of.”

Asked if the FBI suspected the gunman might have had inclinations toward militant Islam, including a possible sympathy for Islamic State, Ronald Hopper, an assistant FBI agent in charge, told reporters: “We do have suggestions that the individual may have leanings toward that particular ideology. But right now we can’t say definitively.”

The FBI said it was still trying to pin down whether the mass shooting was a hate crime against gays or a terrorist act.

U.S. Senator Marco Rubio of Florida told CNN he understood that the gunman had worked for a security company and so would have undergone some background checks.

“Over the next couple of days they’re going to be looking to see where this individual was inspired to carry out this horrifying act of terrorism,” Rubio said. “I think we’re going to be talking about a very different kind of case here soon.”

President Barack Obama ordered the federal government to provide any assistance needed to Florida police investigating the shooting, the White House said in a statement.