A 41-year-old man was sentenced Friday to 40 years to life in prison for sexually assaulting a girl he is related to, starting when she was 4 years old.

Margarito Gomezdelacruz was convicted Sept. 1 of six felony counts of sexually assaulting the girl in 2014 and 2018, according to court records. One felony count from 2012 was dismissed when jurors deadlocked on it.

The defendant molested the girl at a park in Placentia when she was 4 years old, and again sexually assaulted her in a closet when she was 9 years old at their home in Santa Ana, police said in testimony from the defendant’s preliminary hearing.

The victim suffered some bleeding, alarming her mother enough to take steps to barricade the girl’s room at night to stop any attacks when she went to bed, police testified.

Gomezdelacruz was ordered to register as a sex offender for life. He has 1,509 days credit behind bars.