He also said Soto didn’t want to come to court for sentencing and became frightened when she saw Lewis and his parents in the courtroom.

When homicide detectives reinterviewed her on Jan. 19, Hackbush said, she reasserted her identification of Lewis as the shooter and admitted that she had been scared at sentencing.

In her ruling Thursday letting Lewis withdraw the plea, DiTullio said he had decided to plead guilty based on “representations made to him that the proof against him was very strong and included the expectation the alleged victim ... would identify him as her assailant were the matter to go to trial.”

“While this court ascribes no fault or misfeasance on the part of the prosecution,” she said, “defendant’s mistaken reliance on representations that the evidence against him would include a positive identification of him as the shooter, and the victim’s revelation that, in fact, he is not the perpetrator, require an exercise of discretion on this court’s part permitting the defendant to withdraw his guilty plea.”

She said the prosecution’s contention that there is an explanation for the victim’s statement at sentencing that Lewis is not the one who shot her “is not pertinent” to the court’s decision on the defense motion to withdraw the plea.

“The motivation or reasons behind Ms. Soto’s in-court declarations is an issue of credibility for another day and one best left to a jury,” she said.

Lewis, of Gibson Street, faces a jury trial Oct. 16 before DiTullio on charges of second-degree attempted murder, first-degree assault and second-degree criminal possession of a weapon in the shooting at about 9:50 p.m. Aug. 30, 2012 at Wood and Walden avenues.

He also faces trial July 7 before State Supreme Court Justice Penny M. Wolfgang on charges of second-degree murder and second-degree weapon possession in the shooting of Jeremy Thomas on Aug. 8, 2012 on Summer Street. Thomas, 23, was shot in the head and chest, and died of his wounds two weeks later in Erie County Medical Center.

Lewis had pleaded guilty as charged last September in the non-fatal shooting.

About 15 minutes before the shooting, Angelica and some other girls had had an altercation with Lewis’ girlfriend. At one point, prosecutors said, Angelica asked the girlfriend if she was going to get “your boyfriend to shoot me now.”

When Lewis arrived and confronted Angelica, he asked, “Did you jump my girl?”

After Angelica told him that she did not think he would do anything, he fired at her five times, including three times as she lay on the ground, prosecutors said. She was struck twice.

As Lewis fled the scene, he said, “I don’t give a (expletive) about nobody,” according to court records.