CHICAGO — It began in a way gun advocates have suggested would curtail violence. A gun comes out. Shots are fired. A “good guy with a gun” steps in to help before police can respond.

The tidy theoretical doesn’t account for the chaotic unknowns when police arrive and can’t tell a “good guy” with a gun from a “bad guy” with a gun.

The theory turned to grim reality at Manny’s Blue Room Bar in Robbins, Ill., outside Chicago early Sunday.

Police shot and killed the good guy. Jemel Roberson, 26, was working security.

“Everybody was screaming out, ‘He was a security guard,’ and they basically saw a black man with a gun and killed him,” witness Adam Harris told WGN.

The incident may become a touchstone in a persistent debate about how places such as schools, nightclubs and houses of worship should steel themselves against gunmen.

That debate has gained urgency during the past year, as President Trump and others have repeatedly said security guards — specifically armed ones — could have prevented the nation’s mass shootings; earlier this year, Trump tweeted his support for the controversial idea of arming teachers.

And the Sunday incident has already provoked concerns that black men, even when legally carrying firearms or employed in a position that allows their use, can still become a target for police fire.

Roberson’s friends said he had talked all his life of becoming a police officer himself.

“Now you have to question the police and what they’re actually doing,” 21-year-old Christian Torres said. “This is someone who was on their side.”

Roberson had a valid gun owner’s license but did not have a concealed-carry permit, WGN reported. In Minnesota in 2016, Philando Castile was killed by an officer during a traffic stop seconds after he told an officer there was a weapon in the car.

Details about the Illinois shooting were unclear Monday. Midlothian Police Chief Daniel Delaney said in a statement that officers from his department and the Robbins Police Department responding to a shooting found multiple victims inside the bar.

The statement said the “Midlothian officer encountered a subject with a gun” and shot him.

Delaney did not elaborate on what occurred before the police response.

The incident began with a confrontation involving several men, and a man left to retrieve a gun. He returned to the bar and opened fire, striking several people, the Chicago Tribune reported, citing remarks from Robbins Police Chief Roy Wells. At least four others were injured.

Roberson returned fire and apprehended one suspect, the Tribune reported, as officers from suburban police departments responded.

It is unclear how the killing unfolded from there — how and whether officers identified themselves, whether Roberson was holding a gun, or how much time passed before the officer fired at Roberson, who was pronounced dead at a hospital.

The Cook County Sheriff’s Office and the Robbins Police Department, neither of which responded to requests for comment, are investigating the shooting that first drew the police to the scene, Delaney said.

Illinois State Police will investigate Roberson’s killing by the Midlothian officer. Delaney did not answer a question about the administrative status of the officer.

Roberson is one of at least 840 people who have been shot and killed by police so far in 2018 and one of at least 19 in Illinois, according to a Washington Post database.

At least 181 of those shot and killed by police this year — 22 percent — were black. The U.S. population is about 13 percent black.

More than half of those killed — 459 people, including Roberson — were said to have a gun when police killed them.

The oldest of four children, Roberson grew up in Wicker Park, a neighborhood in the North Side of Chicago located about 27 miles from Robbins. His family said he was in law school and served as a positive role model for his peers, inspiring young men to become involved with the church.

“He was dedicated to the Wicker community in a real positive way.” said Malik Harris, Roberson’s 20-year-old cousin.

The Rev. Marvin Hunter told the Associated Press that Roberson played organ at his church and others in the area. He called him an “upstanding” young man who was working to regain custody of his son and earn money for a new apartment.

Hunter is the great-uncle of Laquan McDonald, a black teenager who was shot and killed by a white Chicago police officer in 2014.

Roberson’s friends and family say they are planning a way to memorialize him. According to the AP, Roberson’s mother, Beatrice, filed a lawsuit seeking $1 million from the community and officer who shot her son.

Justin Jouvenal and Wesley Lowery contributed to this report.

Read more:

The Washington Post database on fatal police shootings

As Camp Fire death toll climbs, investigators face grim task of finding remains