The identification of the attacker as Jessie Javier Carlos, a Catholic, proves that claims of responsibility by the Islamic State group for Friday's attack were false.
The identification of the attacker as Jessie Javier Carlos, a Catholic, proves that claims of responsibility by the Islamic State group for Friday's attack were false, President Rodrigo Duterte and police said.
"I would call him a habitual gambler. He lost everything in his life and became crazy. He lost his mind. He vented his anger (through the incident)," Duterte told reporters on Sunday.
"It's not terrorism."
Manila police chief Oscar Albayalde said Carlos, 43, had three children and had been banned from all casinos in April by the Philippine Amusement and Gaming Corporation (Pagcor) following a request from his family because of his gambling addiction.
"He is heavily indebted due to being hooked to casino gambling. This became the cause of misunderstanding with his wife and parents," Albayalde said as he sat alongside Carlos's parents and wife at a press conference announcing the gunman's identity.
"He was barred by Pagcor from all casinos because of the request of next of kin. This could have probably triggered him. That's why he was so mad at casinos."
Carlos walked into the Resorts World casino and hotel complex in Manila on Friday with an M4 automatic rifle and a bottle of petrol, before setting alight a number of different rooms in the complex, according to police accounts.
Thirty-seven people died in the fires, dozens more were injured in a stampede to escape, and Carlos was found dead about five hours later in a hotel room after committing suicide by setting fire to himself, police had said.
Security film of the incident released on Saturday showed the gunman calmly and slowly walking through the casino and firing into the air most of the time, apparently as warning shots for people to leave.
At one point he fired at security guards when they confronted him, but missed. After they ran away, he calmly walked up some stairs.
The video also showed him breaking into a secure room where chips and money were being kept, apparently intent on stealing what he could.
Carlos set alight many gambling tables in what police said was probably an attempt to create a diversion so he could escape.
At Sunday's press conference, Carlos's tearful mother said he had been a good man who committed the violence because of his gambling addiction.
"We ask for forgiveness. My son was a good child to us. But since he started playing at the casinos, that's all he did. He did not visit us. It was painful for us not to see him," said his mother, Teodora Carlos.
Albayalde said the "high-roller" Carlos had worked in the Department of Finance but had been sacked because he had lied on official forms about unexplained assets and properties.
The finance department said Sunday that Carlos was sacked as a tax specialist in 2014 for not declaring properties and for taking mysterious loans far more than a bank would lend.
Authorities had repeatedly insisted on Friday and Saturday the attack was not terrorism-related, just a bizarre robbery attempt by a deranged man.
But IS claimed responsibility, with a report on its self-styled Amaq news agency saying its "fighters" carried out the attack.
Duterte has repeatedly warned that IS is gaining a greater foothold in the mainly Catholic Philippines.
Those concerns escalated when militants flying black IS flags rampaged through the Philippines' main Islamic city in the south nearly two weeks ago, triggering clashes that are still continuing and have left roughly 200 people dead.
Duterte declared martial law in the south of the Philippines on May 23 in a bid to quash the rising IS threat, and said he was prepared to impose military rule nationwide if terrorism spread.
After identifying Carlos as the attacker on Sunday, Albayalde repeatedly sought to discredit IS.
"We will not allow people or any threat group to use this situation to advance their propaganda or personal causes, whether foreign or local," Albayalde said.