The gunman who killed three people at a mall near Indianapolis likely would have taken many more lives if not for the “heroic” actions of an armed bystander who shot the suspect and stopped the attack, police said Monday. Elisjsha Dicken, 22, who was legally carrying a concealed handgun at the time, “engaged” the suspect Sunday almost immediately after he opened fire with a rifle in a food court at Greenwood Park Mall in Greenwood, Indiana, authorities said. Police said they did not know the motive behind the rampage. Dicken immediately became a cause célèbre for gun rights advocates, who argue — despite government statistics to the contrary — that armed citizens are the best defense against the kinds of random mass shootings that have killed more than 100 people in the United States. last year. Greenwood Police Chief Jim Eason credited Dicken, who was at the mall with his girlfriend Sunday night, as a hero whose bravery and skill prevented further bloodshed. Dicken now needed “space and time to process what he’s been through,” the chief said in an appeal for media restraint. Although he had no law enforcement or military training, Dicken demonstrated “satisfactory” and “tactically sound” movements in shooting “the gunman with a handgun at long range,” Eason told reporters. “As he bound and restrained the suspect,” Dicken motioned for others in the vicinity to get behind him, the chief said, adding that Dicken then surrendered to mall security personnel and cooperated with police. The shooting lasted just two minutes from the time the suspect opened fire until he was killed. Earlier, the gunman had spent more than an hour in a mall restroom, apparently preparing the attack and assembling the deadly weapon he carried disassembled in a bag, the chief said. Dicken was initially handcuffed and his gun confiscated before being taken to the police station for questioning, where his account was verified by video, according to Eason. “A lot more people would have died last night if it wasn’t for a responsible armed citizen who took action very quickly within the first two minutes of the shooting,” Eason said. The gunman was identified as Jonathan Douglas Sapirman, 20, an area resident who lived alone, quit his job at the warehouse in May and had recently been evicted, the chief said. Ison said Sapirman had no prior criminal history, other than a juvenile record, including a fight at school and a runaway incident. He was not driving and is believed to have gone to the mall Sunday, the chief said. Eason said the suspect had two rifles he had purchased in March and a handgun with multiple magazines of ammunition and more than 100 rounds, and that he fired about 24 rounds from one of the rifles. He had been frequenting a local shooting range for target practice for the past two years. Of the three dead, two were husband and wife, aged 56 and 37, respectively. The third was a 30-year-old man. Two other people were injured, Ison said. A spate of gun violence in public places since May, including mass shootings at a grocery store in upstate New York, a Texas elementary school and an Independence Day parade in suburban Illinois, has renewed a fierce debate in the US over regulations on the weapons. Gun rights advocates seized on the latest shooting as an example of why it’s important to allow Americans to carry firearms. “We’ll say it again: The only way to stop a bad guy with a gun is a good guy with a gun,” the National Rifle Association tweeted Monday morning. It is rare for a bystander to stop an “active shooter” attack in the United States, according to an FBI report in May showing that only two of 61 such attacks last year ended when “citizens engaged the shooter.” A similar New York Times analysis found that only 22 gunmen in 433 mass shootings since 2000 were shot by a bystander. The Greenwood incident also raised questions about the interplay between state law and the rights of private entities to ban guns on their property. The shooting comes weeks after Indiana repealed its gun license requirement. Now, anyone age 18 or older who is not legally prohibited from owning a firearm can generally carry a concealed weapon in public. The law conflicts with the policy of Simon Property Group, owner of Greenwood Park Mall, which prohibits guns on its properties, according to its website. The Indianapolis-based company was unavailable for comment Monday. On the mall’s website, the company posted a message saying it was “grateful for the strong response of first responders, including the heroic actions of the Good Samaritan who stopped the suspect.” The company said the mall was closed Monday. According to Indiana Attorney General Todd Rokita, private businesses may restrict gun owners from carrying a gun on their property. Even so, it’s generally not against the law to ignore a “no firearms” sign at a private business, he wrote in the state’s Gun Owners’ Bill of Rights before Sunday’s shooting. Rokita said the only consequence for ignoring a company’s ban can come when someone carrying a gun ignores a direct warning barring them from entering or ordering them to leave. Our Morning Update and Afternoon Update newsletters are written by Globe editors, giving you a concise summary of the day’s most important headlines. Sign up today.