A 9-year-old boy who was shot to death in a Chicago alley, in one of the most notorious crimes in the city’s recent history, was the target of the shooting, not a bystander who became an accidental victim, officials said Thursday.

The death of Tyshawn Lee, killed Monday afternoon while walking to his grandmother’s home, was part of a war between two street gangs, and he was singled out because his father was connected to one of the gangs, Superintendent Garry McCarthy of the Chicago police said at a news conference in the alley. He did not say whether the shooting was in retaliation for a particular act.

“We believe that Tyshawn was targeted, lured to this spot and murdered,” Mr. McCarthy said. “We know the two groups. We know the individuals involved in both groups. And proving who did what is where we are right now.”

He said the police had spoken to some witnesses, but he appealed for more to come forward, calling the killing “probably the most abhorrent, cowardly, unfathomable crime that I’ve witnessed in 35 years of policing.”