Authorities on Monday identified the gunman who shot five people at a suburban Indianapolis shopping mall, killing three of them, before a shopper shot and killed him as a 20-year-old local man.

Jonathan Sapirman, of Greenwood, began firing after leaving a bathroom at the Greenwood Park Mall shortly before it closed Sunday evening, Greenwood police Chief James Ison said at a news conference.

Sapirman continued shooting people until he was shot and killed by 22-year-old Elisjsha Dicken, of nearby Seymour, who was shopping with his girlfriend, said Ison.

“Many more people would have died last night if not for a responsible armed citizen,” said the chief, noting that authorities were still trying to determine a motive for the attack.

The Johnson County and Marion County coroners’ offices identified the slain victims as a married Indianapolis couple — Pedro Pineda, 56, and Rosa Mirian Rivera de Pineda, 37 — and Victor Gomez, 30, also of Indianapolis.

Ison said that after Sapirman entered the mall, he walked into a bathroom where he spent about an hour before he emerged and opened fire. He said investigators believe Sapirman spent that time preparing and possibly assembling a disassembled rifle that he had brought in his backpack. He ended up firing 24 rounds within two minutes.

Although police don’t know a motive for the attack, Sapirman’s relatives told investigators that he recently received an eviction notice from the apartment where he lived.