A 15-year-old boy appeared in court Saturday on attempted murder charges for allegedly shooting a 7-year-old girl while she was out trick-or-treating.

Chicago police identified the suspect in the Halloween shooting of the girl, who was dressed a bumblebee and out collecting candy, and a 32-year-old man. The girl was shot in the right side of her neck and upper chest and remains in critical condition, and the man was shot in his left hand.

Police said the man and the girl were not together and have no relationship. They said the man shot was not the intended target, according to the Chicago Sun-Times.

The teen, whose name was not released because he is a juvenile, faces two counts of attempted first-degree murder and two counts of aggravated battery through discharge of a firearm, according to a Friday release by Chicago police. Judge Joanne Rosado also told him he is charged with two counts of aggravated unlawful use of a weapon, according to the Chicago Tribune. He’ll be held in detention at least until a second hearing on Monday.

CALIFORNIA HALLOWEEN PARTY SHOOTING LEAVES AT LEAST 4 DEAD

The shooting happened around 5:30 p.m. when three people walked up to another group of people in an alley in Chicago’s Little Village neighborhood on the southwest side. Assistant state’s attorney Jack Ruggiero told the court the boy and several others, at least one of whom was wearing a mask, went out that day “looking for trouble” and looking for a Latin King (member of a Hispanic Chicago street gang). The shooting occurred close to the border dividing rival street gangs.

When they spotted the 32-year-old man on the other side of the alley as the little girl, one of them first tried to shake his hand. They informed him they were Gangster Two-Six members and then chased him, yelling “Two-six!” and “King Killa!” before the suspect fired seven times, hitting the man and the child.

After the shooting, the boy fled down another alley. The group listened to a police scanner and learned the little girl was shot. According to Ruggiero, the boy “urinated on his hands” after learning about the girl to try to get the gunpowder off his hands. The boy told members of his group to “hide the jacket” he was wearing.

Ruggiero said police found the gun used in the attack after witnesses heard the boy say he tossed the gun in an alley near garbage cans and a school before he ran away. Video surveillance recorded him hiding the gun there.

The suspect was arrested around 1:30 a.m. Friday.

“He transformed (the street) into a real-life horror movie,” Ruggiero said. “He showed complete disregard for human life,” when he fired a gun seven times, Ruggiero added.

EVIDENCE IN MOLLIE TIBBETTS MURDER IS INSURMOUNTABLE, LAW ENFORCEMENT SOURCE SAYS

"This minor didn’t care about the 7-year-old girl,'' Ruggiero said. He "involved himself'' in a gang conflict.

The boy’s defense attorney John Miraglia said in court the boy “absolutely” denies the charges. He said the boy has no “publishable” background and said his parents are “good people.” His mother and stepfather appeared in court but gave no comment.

The boy spoke quietly during the hearing, mostly giving the judge yes or no answers. As Judge Rosado read the charges, he said “I have a question,” but the judge did not allow him to elaborate. The boy twisted around to look at his mother, who nodded several times at him as he was taken back into custody.

Family members of the girl who was shot prayed outside Stroger hospital, where she was being cared for, Thursday night. “The family of the 7-year-old girl who was shot in Little Village is grateful for the outpouring of love and support shown by all of Chicago and the nation. She remains in serious condition. At this time, the family is requesting privacy,” a Cook County health department statement said.

CLICK HERE TO GET THE FOX NEWS APP

Local resident Jose Vazquez told the Sun-Times the scene of the attack has been a hotbed for violence. "That alley is crazy,” he said.