LOS ANGELES (CBSLA.com)  —  A former high school teacher pleaded no contest Thursday to two felony charges of false imprisonment, the LA District Attorney’s Office said.

John Edward Maust, 35, entered the plea to two felony counts of false imprisonment by violence, said Deputy DA Melanie Buccat.

Maust was accused of getting in the back seat of a car belonging to one of his students and commandeering the vehicle with two other students in the vehicle.

Los Angeles County Superior Court Judge Elaine Lu immediately sentenced Maust to five years of formal probation, 180 days of community service and more than 50 Alcoholics Anonymous sessions.

RELATED STORY: Students, Faculty React To Arrest Of Arcadia High School Teacher

Maust also was ordered to one year of counseling and to stay away from the victims. Additionally, he is prohibited from consuming any alcohol while on probation.

On June 7, 2014 around 9:35 p.m., three teenagers — two of whom attended Arroyo Pacific Academy where Maust taught — were driving when they saw the defendant in his driveway.

After the victims stopped to talk to the teacher, Maust got into the back seat and told one of the victims to drive, the prosecutor said.

During the drive, Maust took out a pocket knife and began waving it around at which point the driver pulled the car over and two of the victims were able to flee. When the driver attempted to also exit, Maust placed him in a choke hold with the pocket knife and demanded that he be taken to a Jack in the Box, the prosecutor added.

After the victim complied, he drove the defendant home and Maust got out of  the vehicle, according to the prosecutor.