Ax-wielding fairytale character Jack caught a break at the Leighton Criminal Court Building last week, with a hung jury sparing him a conviction for the murder of a giant and the burglary of his beanstalk-topping home.

Children with cheery faces — and whimsical courtroom drama — are rare enough at the West Side courthouse, but the National Black Prosecutors Association also has made the presence of pre-teen prosecutors an annual event with the weeklong Junior State’s Attorneys program.

Now in its second year, the program sent 17 middle school-age black and Latino children to the courthouse last week to learn about forensic evidence and criminal law, and to prepare a mock trial based on the “facts” of the Jack and the Beanstalk fairytale.

Sporting his official Junior ASA blazer at the courthouse, Prescott Elementary School seventh-grader Corey Moses Jr., 12, said he and the defense team felt they had a strong case for acquittal: per the familiar script of the tale, the Giant did threaten to grind Jack’s bones into bread before Jack escaped and chopped down the beanstalk.

“Jack felt threatened, so we believe that Jack acted in self-defense by killing the giant,” said Moses, who was prepping for a cross-examination of the giant’s wife.

Students are nominated from youth programs affiliated with the Chicago Area Project, and roughly half said they knew someone from their neighborhood who had spent time at the courthouse for non-educational purposes, said Tony Lawlor of CAP.

The program is intended to expose pre-teens to legal careers, according to Sierra Wallace, regional director of the NBPA and a prosecutor in the state’s attorney’s narcotics division. A first-generation college graduate who grew up in the Harold Ickes Homes public housing project, Wallace said she knows the importance of showing black and brown students what they can accomplish.

“It’s just necessary, it will always be necessary, to show kids this age — fifth-, sixth- and seventh-graders — that people of color can do great things,” she said.

Wallace said her colleagues in the state’s attorneys office and the public defender’s office volunteered to teach sessions, coaching students on the law, refining arguments and structuring questions. Other sessions include forensic evidence, like dusting for fingerprints and matching boot prints.

For Thursday’s mock trial — the kids’ final day at Leighton, ahead of Friday tours of the Daley Center, Dirksen Federal Building and Illinois Appellate Court — things went smoothly, with Wallace giving the junior lawyers high marks for passion and their courtroom “presence.”

“Some of the kids, they really came out of their shells,” she said, noting that they all were disappointed with the split on the jury that prevented a verdict. “They really wanted them to decide for one side or the other.”