A Northern Liberties teenager who admitted sexually assaulting two neighborhood women in 2008 when he was 15 years old - almost killing one of them - was sentenced today to 20 to 45 years in prison by a Philadelphia judge.

Derrick Cook, now 17, said nothing before being sentenced by Common Pleas Court Judge Benjamin Lerner. His attorney, Alice Meehan, said he was too nervous and read his letter in which he apologized to his victims: "I am ashamed at what I did and I know the person who committed these crimes will not be the same person who comes out of prison."

Lerner's sentence was far below the 80- to 160-year prison term requested by Assistant District Attorney Namratha Ravikant, who argued that one victim would have died had not a pedestrian walking his dog noticed her open door, investigated and called police.

"Except for that man walking his dog, this would have been a murder," Ravikant said.

Lerner said his sentence was based in part on the need to protect society and in part on Cook's age and horrendous childhood - a psychotic, drug-addicted mother and grandparents who feared contacting authorities because they might remove the boy from the family.

The judge described Cook's crimes as almost preordained: "There is no end to the way in which adults charged with the care and raising of children can, either through ignorance, neglect or evil motives, or personality failings can destroy those children lives.

"There is no end to the pain, injury and sheer terror that children who are raised - or should I say not raised - like that are capable of inflecting on indiviudals in the community," Lerner added.

Contact Joseph A. Slobodzian at 215-854-2985 or jslobodzian@phillynews.com.