A black security guard at a bar in the Chicago suburbs was killed by the police as he apparently tried to detain a man he believed to be involved in a shooting, the authorities said Monday.

Officers from several police departments had responded to reports of a shooting early Sunday morning at Manny’s Luxury Lounge in Robbins, Ill., said Sophia Ansari, a spokeswoman for the Cook County Sheriff’s Office.

Witnesses told the police that a fight had broken out and someone had started shooting. After the authorities responded, a police officer shot the guard, Jemel Roberson, 26, who had a gun, Ms. Ansari said. Mr. Roberson died at the hospital.

Witnesses said that people in the crowd had yelled to arriving police officers that Mr. Roberson, who was wearing gear that read “Security,” was a guard. Ms. Ansari confirmed that Mr. Roberson worked for the bar.