ORLANDO, Fla. (AP) — Dozens of bodies were slowly removed late Sunday from a popular Orlando gay club after a gunman sprayed the helpless crowd with bullets in violence that left 50 dead and devastated a city famous for family-friendly theme parks.

When the attacker opened fire in the early hours of Sunday morning, it interrupted an evening of drinking, dancing and drag shows at a club known for tolerance for all people.

Authorities say suspect Omar Mateen emerged, carrying an AR-15 and fired relentlessly — 20 rounds, 40, then 50 and more. In such tight quarters, the bullets could hardly miss. He shot at police. He took hostages.

When the gunfire at the Pulse Orlando club finally stopped, 50 people — including Mateen — were dead and dozens critically wounded in the deadliest mass shooting in modern U.S. history. Mateen, who authorities said had pledged allegiance to the Islamic State in a 911 around the time of the attack, died in a gun battle with SWAT team members.

“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.

Authorities are wondering if it was an act of terrorism and are probing the background of Mateen, a 29-year-old American citizen from Fort Pierce, Florida, who had worked as a security guard. The gunman’s father recalled that his son recently got angry when he saw two men kissing in Miami and said that might be related to the assault.

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

The broadcast is apparently an opportunistic statement as IS has not officially claimed responsibility for the Orlando attack.

Thirty-nine of the dead were killed at the club, and 11 people died at hospitals, Orlando Mayor Buddy Dyer 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 out of the club 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.

On Monday morning, officials emphasized that there was no immediate threat to the public and said they didn’t know whether anyone would be charged as part of the investigation.

Jon Alamo had been dancing at the Pulse 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 would eventually be added to the city’s list of those killed in the shooting.

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.

The previous deadliest mass shooting in the U.S. was the 2007 attack at Virginia Tech, where a student killed 32 people before killing himself.

Mateen’s family was from Afghanistan, and he was born in New York. His family later moved to Florida, authorities said.

A law enforcement official said the gunman made a 911 call from the club in which he professed allegiance to the leader of the Islamic State, Abu Bakr al-Baghdadi. The official was familiar with the investigation, but was not authorized to discuss the matter publicly and spoke on condition of anonymity.

The extremist group did not officially claim responsibility for the attack, but the IS-run Aamaq news agency cited an unnamed source as saying the attack was carried out by an Islamic State fighter.

Even if the attacker supported IS, it was unclear whether the group planned or knew of the attack beforehand.

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.

Asked if the gunman had a connection to radical Islamic terrorism, Hopper said authorities had “suggestions that individual has leanings towards that.”

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

In a separate incident, an Indiana man armed with three assault rifles and chemicals used to make explosives was arrested Sunday in Southern California and told police he was headed to a West Hollywood gay pride parade.

The Orlando shooting started about 2 a.m., with more than 300 people inside the Pulse.

“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.”

At 2:09 a.m., Pulse posted on its Facebook page: “Everyone get out of Pulse and keep running.”

Mateen exchanged gunfire with 14 police officers at the club, and took hostages at one point. In addition to the assault rifle, the shooter also had a handgun and some sort of “suspicious device,” Police Chief John Mina. About 5 a.m., authorities sent in a SWAT team to rescue the remaining club-goers, Mina said.

At first, officers mistakenly thought the gunman had strapped explosives to the dead after a bomb robot sent back images of a battery part next to a body, Mayor Dyer said. The robot was sent in after SWAT team members put explosive charges on a wall and an armored vehicle knocked it down in an effort to rescue hostages.

Just before 6 a.m., the Pulse posted an update on its Facebook: “As soon as we have any information, we will update everyone. Please keep everyone in your prayers as we work through this tragic event. Thank you for your thoughts and love.”

Authorities were looking into whether the shooter acted alone, according to Danny Banks, an agent with the Florida Department of Law Enforcement.

“This is an incident, as I see it, that we certainly classify as domestic terror incident,” Orange County Sheriff Jerry Demings said.

Mateen’s father, Mir Seddique, told NBC News about his son seeing the men kissing a couple of months ago.

“We are saying we are apologizing for the whole incident,” Seddique said. “We are in shock like the whole country.”

Mateen was a security guard with a company called G4S. In a 2012 newsletter, the firm identified him as working in West Palm Beach. In a statement sent Sunday to the Palm Beach Post, the company confirmed that he had been an employee since September 2007. State records show that Mateen had held a firearms license since at least 2011.

President Barack Obama called the shooting an “act of terror” and an “act of hate” targeting a place of “solidarity and empowerment” for gays and lesbians. He urged Americans to decide whether this is the kind of “country we want to be.”

___

Associated Press writers Eric Tucker in Washington, Terrance Harris, Mike Schneider and Tamara Lush in Orlando and photographer Alan Diaz in Fort Pierce, Florida, contributed to this report.