ORLANDO, Fla. (AP) — The last of the bodies were removed from an Orlando gay nightclub overnight as investigators dug into the background of the gunman, who called 911 to profess allegiance to the Islamic State during the attack that left 49 victims dead.

“We will not be defined by the act of a cowardly hater,” Mayor Buddy Dyer vowed on Monday, a day after the deadliest mass shooting in modern U.S. history.

The killer, who died in a gun battle with a SWAT team early Sunday, was identified as Omar Mateen, a 29-year-old American-born Muslim who worked as a security guard in Florida. FBI officials said they had investigated him in 2013 and 2014 on suspicion of terrorist sympathies but could not make a case against him.

Wielding an AR-15 semi-automatic rifle and a handgun, Mateen opened fire at the crowded Pulse Orlando club in such close quarters that the bullets could hardly miss. He was gunned down after police used explosives and a small armored vehicle to punch a hole in a wall and allow dozens of club-goers to escape, police said.

“I’ve always felt so safe here for my family, kids. And now, I don’t know,” said Marlon Massey, who lives across the street from the club, in the city known to tourists around the globe as the home of Walt Disney World and other theme parks.

President Barack Obama called the shooting an “act of terror” and an “act of hate” against a place of “solidarity and empowerment” for gays.

Law enforcement authorities said Mateen made his 911 call from the club. Authorities have not said whether he was directed by the Islamic State or simply acted in sympathy with the extremist group in a so-called lone wolf attack — something counterterrorism experts have been saying for years is extremely difficult to detect and thwart.

The picture became murkier, though, when Mateen’s Afghan immigrant father suggested another motive: anti-gay hatred. The father said his son got angry a few months ago when he saw two men kissing in Miami. And Mateen’s ex-wife attributed the violence to mental illness, saying he was bipolar.

The Islamic State’s radio called Mateen “one of the soldiers of the caliphate in America.” Al-Bayan Radio, a media outlet for the extremist group, hailed the attack, saying that it targeted a gathering of Christians and gays and that it was the worst attack on U.S. soil since 9/11.

It was unclear, though, whether the group planned or knew of the attack beforehand.

Mateen’s father, Seddique Mir Mateen, told reporters Monday that the massacre was “the act of a terrorist,” and added: “I apologize for what my son did. I am as sad and mad as you guys are.”

He wouldn’t go into details about any religious or political views his son held, saying he didn’t know. Asked whether he missed his son, he said: “I don’t miss anything about him. What he did was against humanity.”

Thirty-nine of the dead were killed at the club, and the others died at hospitals, the mayor said. By Monday morning, families of 24 of the victims had been notified, Dyer said.

Workers removed the bodies four at a time on stretchers and loaded them into white vans. The action was repeated over and over. The covered bodies were taken to the county medical examiner’s office. All were there by 11 p.m., Dyer said.

At least 53 people were hospitalized, most in critical condition, and a surgeon at Orlando Regional Medical Center said the death toll was likely to climb.

On Monday morning, officials emphasized that there was no immediate threat to the public.

The shooting started about 2 a.m., with more than 300 people inside the Pulse, where it was Latin night.

“He had an automatic rifle, so nobody stood a chance,” said Jackie Smith, who saw two friends next to her get shot. “I just tried to get out of there.”

Jon Alamo had been dancing for hours when he wandered into the club’s main room just in time to see the gunman. “You ever seen how Marine guys hold big weapons, shooting from left to right? That’s how he was shooting at people,” he said.

“My first thought was, `Oh, my God, I’m going to die,”‘ Alamo said. “I was praying to God that I would live to see another day.”

Pulse patron Eddie Justice texted his mother, Mina: “Mommy I love you. In club they shooting.” About 30 minutes later, hiding in a bathroom, he texted her: “He’s coming. I’m gonna die.”

Justice’s name would eventually be added to the list of the dead.

On the same day as the Orlando attack, an Indiana man armed with three assault rifles and chemicals used to make explosives was arrested in Southern California and told police he was headed to a West Hollywood gay pride parade, authorities said.

The previous deadliest mass shooting in modern U.S. history was the 2007 attack at Virginia Tech, where a student killed 32 people and took his own life.

Mateen was not unknown to law enforcement: In 2013, he made inflammatory comments to co-workers and was interviewed twice, according to FBI agent Ronald Hopper, who called the interviews inconclusive. In 2014, Hopper said, officials found that Mateen had ties to an American suicide bomber, but the agent described the contact as minimal, saying it did not constitute a threat at the time.

Mateen bought at least two guns legally within the last week or so, according to Trevor Velinor of the Bureau of Alcohol, Tobacco and Firearms.

Mateen exchanged gunfire with 14 police officers at the club and took hostages at one point. In addition to the assault rifle, he had a handgun. Police Chief John Mina said officers held back for some time because Mateen indicated he had a bomb vest.

About 5 a.m., authorities sent in a SWAT team to rescue the remaining club-goers, Mina said.

Copyright 2020 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.