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: Chicago Weather: Weekend Warmup Continues

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: At Least 10 Shot, 1 Killed In Weekend Violence In Chicago

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: Bill For Reparations For Black Evanston Residents Soon To Go Up For Vote; Some Say It's Insufficient And Could Make Things Worse

Area South detectives were investigating late Sunday afternoon.