The gray smoke that belched for hours from a popular hotel-casino in Manila was initially dismissed by the police as the work of a disgruntled gambler with a bottle of gasoline. But as day broke over the Philippine capital on Friday, investigators discovered dozens of bodies, upending the government’s explanation of the fire and raising questions about the identity and motives of someone responsible for one of the country’s largest mass killings.
The first victims, identified as 22 guests and 13 employees of Resorts World Manila, appeared to have died of smoke inhalation, the police said, though autopsies had not yet been conducted.
The fire was started in the early hours of Friday morning, when a man carrying an assault rifle and a two-liter soda bottle filled with gasoline fired shots at a television and set gambling tables ablaze, sending patrons and workers into a panic. Some fled through the exits, and others jumped from second-floor balconies. But others hid in restrooms and gambling rooms, where they were overcome by smoke.
“This is also a very difficult time for all of us here in Resorts World Manila,” Stephen Reilly, the resort’s chief operating officer, told reporters. “We consider our guests, patrons and employees as our family.”
Hours after the first reports of an attack, the police and casino officials declared that the building had been cleared and all guests accounted for. But some victims’ family members waiting outside the hotel told a different story as they waited in vain for loved ones to exit.
By midday Friday, as reports of the discovered bodies trickled out, conflicting narratives emerged. The Islamic State claimed responsibility for the assault through its Amaq News Agency. In a brief message in Arabic, it said, “Islamic State fighters carried out the Manila attack in the Philippines yesterday.”
President Trump has called the assault terrorism. But the police discounted that possibility and blamed one irate gambler for it. And American military intelligence officials said they had no credible indication that it was a terrorist attack.
“He could have inflicted maximum casualties, but he did not,” said Oscar Albayalde, a police spokesman, noting that the man passed scores of unarmed, fleeing patrons, who were easy targets if he aimed solely to kill and frighten.
Instead, Mr. Albayalde said, the police were investigating whether robbery, rather than terrorism, was the motive.
One account from the authorities said the attacker took 130 million pesos in chips, worth about $2.6 million, during his spree. How he intended to cash them was not explained.
The police have not publicly identified the attacker. Rappler, a news site, reported that the gunman had been a longtime hotel guest who had a room on the fifth floor and was known to security personnel, which may have made it easier for him to sneak weapons into the resort.
Mr. Reilly, the resort executive, said the gunman had entered the resort’s mall on the second floor from the parking wing and made it past a security checkpoint and X-ray machine by firing shots into the air.
Mr. Reilly corroborated the police accounts that only one gunman was involved, adding that the motive was unclear.
Security guards tried unsuccessfully to slow the gunman, then shot and wounded him, Mr. Reilly said. One guard was also wounded in an exchange of gunfire with the assailant.
“Severe blood loss from the gunshot wound significantly slowed the assailant down and resulted in his holing up in a room where he took his own life,” he said.
The man died by setting himself on fire and shooting himself in the head, the police said.
The authorities said the gunman set fires in the resort’s casino. One man who escaped, a Filipino poker player who did not want to be identified, told the radio station DZMM that the hotel’s sprinklers did not work. Ian Manalo, a spokesman for the Bureau of Fire Protection, said the department was investigating why the fire became so deadly.
The bodies of two more victims were discovered late in the day under a collapsed ceiling, said Tomas Apolinario, chief of Manila’s southern police district, bringing the total number to 37.
One was identified as Elizabeth Gonzales, the wife of a congressman. South Korea’s Foreign Ministry said a South Korean citizen died of a heart attack after fleeing the hotel.
Mr. Apolinario said the authorities were seeking a person of interest, a Philippine citizen, but gave no details about the person or the connection to the attack.
The confusion and contradictory accounts of what happened come in a nation on edge because of a resurgent Islamist militant insurgency in the south, where President Rodrigo Duterte declared martial law last week and said terrorist attacks were a possibility.
Mr. Duterte addressed members of the 102nd Infantry Brigade on the southern island of Mindanao on Friday but made no mention of the attack. Since last month, the military has been locked in a battle against Islamist groups allied with the Islamic State on Mindanao.
On Friday evening, casino staff members held an impromptu Mass outside the resort and planted candles on the curb. As the names of the dead were read, employees wiped away tears.