A 16-year-old boy was shot to death when he allegedly tried to rob a 24-year-old man Saturday in west suburban Oak Park, police said.

The teenage boy, whose identity was not released, allegedly tried to rob the man about 11:15 a.m. in a bank parking lot near Madison Street and Austin Boulevard, according to a statement from Oak Park police.

The man was legally armed and exchanged gunfire with the boy, police said.

The boy got into a waiting vehicle and drove off into Chicago, police said. He was taken to Stroger Hospital, where he was pronounced dead.

An off-duty Chicago police officer who was nearby detained the man, who is being questioned by investigators, police said. He has a valid Illinois conceal-carry permit.

Anyone with information on the shooting is asked to contact police at (708) 386-3800. Anonymous tips can be left at (708) 434-1636 or oak-park.us/crimetip.