CHICAGO (CBS) — Three victims were shot on the Southeast Side on Sunday and one was killed, but one of the victims shot and killed one of the gunmen, police said.

The shooting happened at 3:48 p.m. in the 10000 block of South Avenue M. Three men – ages 20, 27, and 39 – were standing in the street when a vehicle pulled up and two men got out, police said.

READ MORE: 'John Doe' Who Accused Former Blackhawks Video Coach Brad Aldrich Of Sexual Abuse Identifies Himself As Kyle Beach

Both of those two men took out guns and fired shots at all three victims, police said. The 27-year-old man – who had a valid Concealed Carry permit – shot and killed one of the gunmen, police said.

The man who killed the gunman was also wounded by gunfire himself. He was taken to Advocate Trinity Hospital in good condition with a gunshot wound to the left arm, police said.

READ MORE: Chicago Weather: Showers Coming Thursday

The 39-year-old victim was taken to the University of Chicago Medical Center in critical condition with gunshot wounds to the leg and abdomen, police said. He was later pronounced dead.

The 20-year-old man suffered a gunshot to the right arm and was also taken to Advocate Trinity, where his condition was stabilized.

The surviving gunman got back into the vehicle and left, police said.

MORE NEWS: View Live Radar

Area South detectives were investigating late Sunday afternoon.