SANTA ANA, Calif.—A Southern California man has been sentenced to three years in prison for molesting an 8-year-old boy outside a fast-food restaurant.

Orange County prosecutors say 35-year-old Pedro Castillo-Sanchez pleaded guilty to a felony count of lewd acts with a child under 14, as well as a sentencing enhancement for substantial sexual conduct with a child.

He was sentenced on Wednesday. He must also register for life as a sex offender.

A news release says Castillo-Sanchez, who was a family friend, drove the boy to a Santa Ana fast-food restaurant in March and molested the boy in the parking lot. The boy told his mother and Santa Ana police arrested him.