The two Los Angeles women accused of burning, starving and beating the 5-year-old son of one of the women have pleaded no contest to causing corporal injury to a child.

The boy’s mother, Starkeisha Brown, was sentenced to 15 years in prison after entering the plea on Friday. Her live-in girlfriend Krystal Matthews received a 14-year term.

The two would have faced 25 years to life in prison if convicted. They avoided trial by pleading no contest, and prosecutors said the boy won’t have to testify.

The boy was found ill and in the care of a homeless stranger outside a county child services office in Compton in 2008.