A mother of 10 pleaded guilty Wednesday in the starvation death of her disabled daughter, but her lawyer said social workers and city officials share the blame.

Andrea Kelly, 39, was immediately sentenced to 20 to 40 years in prison after pleading to third-degree murder.

A grand jury investigation of the 2006 death of Danieal Kelly, who was 14 years old and weighed just 42 pounds, ignited fury in the city and prompted last year's ouster of two top city welfare officials. Nine people were criminally charged, including the girl's parents and four social workers.

"If anybody at DHS (the Department of Human Services) actually showed up, the child would have been removed from the home eight to nine months earlier," defense lawyer Richard Q. Hark said after the hearing. "She would have lived."

Danieal — once a chubby-cheeked child who beamed in photographs taken on school trips — had deteriorated in the years since her father split with a stepmother in Arizona and she returned to her mother's care in Philadelphia. She lost more than half her body weight and never left the dark, squalid house for school or even fresh air.

Danieal suffered from cerebral palsy and could not walk. In her last days alive, during an August heat wave, the bedridden girl had flies and maggots hovering near her open sores and could muster only enough energy to ask a brother for "water." He begged their mother to call an ambulance but was rebuffed, according to the grand jury report.

"I do accept my part in my daughter's death. I wish I could have done more than I did to save her," Andrea Kelly told a judge Wednesday, as an older son listened from the back row, the lone child in attendance. The minor-age children have been in foster care since Danieal's death.

Prosecutors will now focus on the remaining defendants, including social worker Julius Murray, who is charged with involuntary manslaughter, a misdemeanor. Murray worked for MultiEthnic Behavioral Health, a city contractor paid to help DHS provide services to needy families.

The grand jury charged that Murray rarely if ever made the required twice-a-week visits and that he and a company owner forged reports to cover up their inaction.

"Though it was her mother who actually killed her, there are many layers of blame for what happened to Danieal Kelly: from parents, to caseworkers, to supervisors, to administrators," states the 258-page grand jury report, issued last year.

Murray insists he made the visits, said his lawyer, Will Spade.

Assistant District Attorney Ed McCann called such an assertion "ludicrous."

"This child's decline cold not have been missed by anyone," McCann said Wednesday. "If anyone would have been in that house in the months prior to her death, they would have seen a child starving to death."

The father, Daniel Kelly of Darby, Pa., is charged with child endangerment for allegedly deserting his daughter after they moved back to Philadelphia.

Meanwhile, the parents have a civil suit pending against the city on behalf of Danieal's estate, a suit the mayor and district attorney once deemed "obscene." Lawyers involved say the likely beneficiaries are Danieal's siblings, especially if both parents are convicted.