Witnesses described scenes of horrific carnage. Victims flooded local hospitals with gunshot wounds to their chests, legs and arms. Some had their calves and forearms blown off, doctors said. Police said the toll could have been even greater had a SWAT team not rescued 30 people and shepherded them to safety. Many of the victims were Latino; the club was celebrating “Latin Night.”

AD

AD

“We’re dealing with something we never imagined and is unimaginable,” said Orlando Mayor Buddy Dyer (D), who declared a state of emergency in the city.

The gunman was identified as Omar Mateen, a 29-year-old security guard who was born in New York to Afghan parents. After his initial assault on the dance club, Mateen called 911 and pledged allegiance to the leader of the Islamic State, also known as ISIS, according to federal law enforcement officials, who spoke on the condition of anonymity because the FBI investigation is unfolding. During the call, Mateen made reference to the 2013 bombing of the Boston Marathon, officials said.

The shooting raised fresh alarm about the ability of overseas terrorists to wreak havoc on U.S. soil. But it also ignited fears of a broader campaign against the American gay, lesbian and transgender community as the first anniversary of the landmark Supreme Court decision legalizing same-sex marriage approaches.

AD

AD

Hours after the Orlando attack, police in Southern California reported arresting a heavily armed man who said he was headed to a gay pride parade in the Los Angeles area — though authorities later said they were mistaken about the man’s target. Meanwhile, in Washington, police stepped up patrols ahead of the Capital Pride Festival, one of dozens of gay pride events scheduled this month across the nation and around the world.

“As Americans, we are united in grief, in outrage, and in resolve to defend our people,” Obama said during a brief speech at the White House, where he said the FBI is investigating the Orlando massacre as an act of terrorism. Until Sunday, the 2007 rampage at Virginia Tech — in which 32 people died — was the country’s worst mass shooting.

Throughout the day, relatives and friends of missing clubgoers gathered at a downtown Hampton Inn & Suites to await news of their loved ones. On Sunday evening, as the names of the dead began to trickle out, the scene in the hotel’s sweltering lobby turned tragic.

One woman sat in a chair next to a stack of pizza boxes, sobbing and screaming. Another woman crumpled in her chair, crying, and was taken out in a wheelchair. A third woman vomited into a trash can. Others hugged, shook and softly cried as grief counselors and law enforcement officials milled about.

AD

AD

Condemnations of the carnage in downtown Orlando flooded the airwaves from officials and pundits across the political spectrum. But late Sunday, many questions remained unanswered. It was unclear, for example, how a lone gunman managed to hold so many people inside the nightclub for so long, whether any of the clubgoers tried to stop him and why police waited three hours to intervene. A clear timeline of events, including when the victims were killed and injured and who shot them, remained elusive.

Authorities declined to offer details. But a senior U.S. law enforcement official said officers delayed their assault on the gunman because the active-shooter scene turned into a hostage negotiation once the gunman called 911. For three hours, the gunman was on the phone with police and no shots were fired.

“That is when you do wait,” said the official, who spoke on the condition of anonymity because he was not an authorized spokesman. “It was appropriate.”

AD

AD

Police ultimately chose to end the standoff because of concerns about the health and safety of dozens of people who were injured and trapped inside. Officials at nearby Orlando Regional Medical Center said at least nine people died at the hospital or were dead when they arrived. It was unclear whether anyone was injured during the gunman’s final shootout with officers, although authorities said that one Orlando police officer was shot but his Kevlar helmet saved him.

The Islamic State has repeatedly executed gay people and released videos showing their gruesome executions. FBI Special Agent Ron Hopper said the bureau was still working to determine whether sexual orientation was a motive in the Orlando attack. He said investigators had found no indication that Mateen had outside help in planning the attack, nor any sign of other suspects or further threats to the public.

Much was also still to be learned about Mateen’s background, although details about his previous contacts with law enforcement officials began to emerge. Much like Tamerlan Tsarnaev, the older of the two brothers who carried out the Boston Marathon bombing, Mateen had been on the FBI’s radar.

AD

AD

Hopper, who runs the FBI’s Orlando office, told reporters that Mateen had twice been investigated by the bureau and was cleared both times.

In 2013, Hopper said agents twice interviewed Mateen after he made “inflammatory comments to co-workers alleging possible ties to terrorists.” The FBI closed the investigation after it was unable to verify the details of his comments, Hopper said.

The following year, FBI agents examined possible ties connecting Mateen to Moner Mohammad Abusalha, the first American to carry out a suicide attack in Syria. Like Mateen, Abusalha lived in Fort Pierce, Fla.

“We determined that contact was minimal and did not constitute a substantive relationship or a threat at that time,” Hopper said.

AD

Meanwhile, Sitora Yusifiy, Mateen’s ex-wife, said in an interview Sunday that he beat her repeatedly during their brief marriage and that Mateen, who was a Muslim, was not very religious and gave no indication that he was devoted to radical Islam.

AD

“He was not a stable person,” she said. “He would just come home and start beating me up because the laundry wasn’t finished or something like that.”

On Sunday, the gunman was armed with a handgun and an assault rifle and was carrying additional rounds.

“It appears he was organized and well-prepared,” Orlando Police Chief John Mina said.

Mateen had legally purchased the two guns — which the Bureau of Alcohol, Tobacco, Firearms and Explosives said were a ­.223-caliber AR-15-type assault rifle and a 9mm semiautomatic pistol — within “the last few days,” according to Trevor Velinor of the ATF. The AR-15 is the civilian variant of the M16 military rifle and is one of nation’s most popular weapons. A standard magazine carries about 30 bullets.

AD

The violence in the crowded nightclub began as Saturday gave way to Sunday. About 2 a.m., Pulse Orlando posted an urgent message on Facebook: “Everyone get out of pulse and keep running.”

AD

Within minutes, police vehicles and a SWAT team descended on the club.

“I was there,” Ricardo J. Negron posted on Pulse’s Facebook page several hours later.

“Shooter opened fire @ around 2:00am. People on the dance floor and bar got down on the floor and some of us who were near the bar and back exit managed to go out through the outdoor area and just ran. I am safely home and hoping everyone gets home safely as well.”

Many of the injured were taken to the regional medical center, which was locked down until Sunday afternoon. The hospital permitted only two family members at a time to go inside, leaving 45 people waiting in the 84-degree heat.

AD

Some people emerged from the hospital with tears streaming down their faces. One woman lay on the ground, moaning “no” over and over until her family led her away.

AD

Joannette Martinez said her family became worried when they couldn’t find her 24-year-old sister, Yilmary. It was Yilmary’s first time at the club, Joanette said; she was celebrating a visit from her brother-in-law.

“No one’s told us anything,” Martinez said as she sat on the sidewalk, her back to the hospital, after waiting for several hours.

At the Hampton Inn & Suites, Jose Honorato waited with his seven siblings for word about his younger brother Miguel.

“He was at the club with three friends. They made it out safely when the shooting started, but they don’t know if he made it out,” Honorato said.

Honorato said he had called Miguel’s phone, but it just kept ringing and went to voicemail.

Police described a hellish scene inside the nightclub, which was strewn with bodies. “It’s absolutely terrible,” Mina said. “Fifty victims in one location, one shooting.”

The massive law enforcement response included a number of federal agencies. Attorney General Loretta E. Lynch, who was scheduled to attend a meeting in Beijing on cybersecurity, said Sunday that she was returning to Washington so she could monitor the investigation.

At the White House, Obama met with FBI Director James B. Comey and then briefly addressed the nation, saying the entire country stands “with the people of Orlando, who have endured a terrible attack on their city.”

The president said it was too early to know “the precise motivations of the killer,” but that the FBI would investigate possible links between the gunman and terrorist groups.

Echoing comments he has made after other mass shootings, Obama said the bloodshed served to highlight how easily people can obtain guns in the United States. He also signed a proclamation honoring the victims and ordering that American flags be flown at half-staff until sunset Thursday.

In Orlando, Joshua and Mary Zika, who live less than a block from the nightclub, said they were particularly appalled that the shooter had appeared to target a particular group.

“We’re proud of our gay community in Orlando,” Mary Zika said.

By early Sunday evening, a Florida LGBT advocacy group had raised nearly half a million dollars for the victims. More than 11,000 people had donated to Equality Florida’s GoFundMe page in six hours, raising more than $480,000. The funds will go directly to victims and their families, according to the page.

Sunday’s rampage followed another shooting in Orlando: The fatal slaying Friday night of a pop singer who was killed while signing autographs after a performance at an Orlando concert venue.

Christina Grimmie, a 22-year-old singer who was a finalist on NBC’s “The Voice,” died hours after she was shot by a gunman who then shot himself, police said.

The scene in Orlando after a gunman opened fire at a nightclub share Share View Photos View Photos Next Image An injured person is escorted out of the Pulse nightclub after a shooting rampage, Sunday morning June 12, 2016, in Orlando, Fla. A gunman wielding an assault-type rifle and a handgun opened fire inside a crowded gay nightclub early Sunday, killing at least 50 people before dying in a gunfight with SWAT officers, police said. It was the deadliest mass shooting in American history. (AP Photo/Steven Fernandez)