An Oklahoma judge says a teenager who pleaded guilty in the traffic death of another teen must attend church for the next 10 years to keep out of prison.

The 17-year-old was sentenced this week after pleading guilty as a youthful offender to manslaughter in the death of his passenger, 16-year-old John Luke Dum. Authorities say the teen had been drinking when he crashed his pickup into a tree, killing Dum.

The Tulsa World reports that Judge Mike Norman handed down a 10-year deferred sentence, meaning the teen can avoid prison if he meets all conditions.

Those conditions include attending church and graduating from high school and welding school.

The teen's attorney, Donn Baker, says his client already attends church regularly and that they're grateful he received probation.