Chicago gangbangers allegedly executed a 9-year-old schoolboy because they blamed his dad’s rival gang for shooting some of their family members, according to prosecutors.

Little Tyshawn Lee was still in his school uniform when he was befriended by his killers in the playground in the city’s South Side in Nov. 2015, jurors were told on the opening day of the trial Tuesday.

The fourth-grader was lured into an alleyway with the promise of a juice box — then executed in broad daylight, prosecutors said.

“Tyshawn brought a basketball to Dawes Park. Corey Morgan, Dwright Doty and Kevin Edwards brought guns,” Cook County Assistant State’s Attorney Margaret Hillmann told the court, naming the accused killers.

Boone-Doty and Morgan are both being tried on first-degree murder charges, but in front of separate juries — because they blame each other for the horrific execution, according to the Chicago Tribune.

Getaway driver Edwards pleaded guilty earlier this month to first-degree murder in exchange for a 25-year prison sentence. He is not expected to testify against his co-defendants, according to the Tribune.

Morgan’s attorney, Thomas Breen, used his opening remarks to try to distance his client from the crime.

“That execution of that 9-year-old boy has to come from one singularly evil person,” Breen told jurors. “His killer did so of his own volition and for his own reason. Not at the behest or help of Corey Morgan.”

However, prosecutors claim it was revenge for an attack weeks earlier that killed Morgan’s brother and wounded his mother — allegedly by the boy’s dad’s gang, the Killa Ward faction of the Gangster Disciples.

Morgan was heard warning of retaliation against “grandmas, mamas, kids and all,” Hillmann said.

“Shooting Morgan’s mother was beyond the pale,” she told jurors of the alleged motive. “There weren’t many rules in this feud, but family was off-limits. They were untouchable.”

Boone-Doty’s attorney, Brett Gallagher, blamed the crime on “the Morgan family’s motive, the Morgan family’s guns, the Morgan family’s crimes.”

However, prosecutors say Boone-Doty is the one who ultimately lured the fourth-grader into an alley and then shot him. His DNA was found on the basketball that was found next to Tyshawn’s body, the court heard.

“Dwright Doty took out a .40-caliber handgun, and he executed Tyshawn in broad daylight,” Hillman told jurors, saying Morgan and Edwards watched from a black SUV.

Tyshawn’s father, Pierre Stokes, meanwhile, is being held without bail on charges that he shot three people — including Morgan’s girlfriend — four months after his son’s murder.

As many as 15 shootings can be pinned on the warfare between the two rival gangs, according to the Tribune.

With Post wires