A judge on Friday granted a motion by the Philadelphia District Attorney’s Office to revoke bail for a North Philadelphia man in an illegal-gun-possession case that preceded his arrest last month in a shooting that critically injured an 11-month-old boy in Hunting Park.

Francisco Ortiz, 29, is charged with attempted murder, aggravated assault, and related offenses in the Oct. 19 shooting of Yazeem Jenkins, who was in a car with his father and stepmother. Police have also said that Ortiz supplied an AK-47 rifle used by another man in a shooting the next day that killed 2-year-old Nikolette Rivera in Kensington.

Given Ortiz’s arrest in Yazeem’s shooting, and the fact that he spent 10 years in state prison on two illegal-gun-possession cases as an adult, Common Pleas Court Judge Zachary Shaffer on Friday granted a motion by Assistant District Attorney Jeff Hojnowski to revoke bail in a July gun-possession case in which Ortiz faces trial.

Hojnowski told the judge that Yazeem is “in very, very critical condition” at Children’s Hospital of Philadelphia, and that authorities had interviewed an eyewitness to the shooting.

Defense attorney Timothy Tarpey contended that the bail revocation request was “unnecessary,” given that bail has been denied for Ortiz in the child’s shooting.

Ortiz was arrested twice in 2008 on gun-possession charges when he was 18. He pleaded guilty in both cases and was sentenced in 2009 by then-Common Pleas Court Judge Ellen Ceisler to five to 10 years behind bars. He served the maximum 10-year sentence and was released in April.

Three months later, on July 13, Ortiz was arrested again on illegal-gun-possession charges. His bail was originally set by Magistrate Sheila Bedford at $100,000, but after his preliminary hearing July 30 — in which Ortiz was held for trial on three gun-violation charges — Municipal Court Judge Craig Washington granted a motion by public defender Megan Helfrich to reduce his bail.

Helfrich asked the judge to reduce bail to the guideline range of $3,000 to $12,000 because, she said, Ortiz did not use the gun he had on him in July. Assistant District Attorney Danielle Derohannesian said if the judge were “so inclined to lower” bail, her office “would object to the bail being lower than $50,000,” according to the hearing transcript.

After Washington agreed to reduce the bail to $50,000, Ortiz was released from a city jail that day, after a bondsman posted a surety bond for the full amount of his bail.

Ortiz has a lengthy criminal history starting when he was arrested at age 10 in 2001, on weapon possession and criminal mischief charges, and was adjudicated delinquent later that year, according to juvenile records obtained by The Inquirer. As a juvenile, he was arrested six more times, and was in and out of juvenile detention facilities. In addition to his weapon-possession case, he was adjudicated delinquent in two criminal-trespass cases when he was 12 and 14, and for a felony escape that occurred when he was 14.