The man described as a “serial flasher” who targeted women walking near the UCLA campus was sentenced to jail time, probation and counseling sessions, officials with the Los Angeles City Attorney’s office said in a written statement Wednesday.

Jason Kirk Lanning pleaded no contest to eight counts of lewd conduct Tuesday. The 39-year-old man from Sherman Oaks was arrested in January after police said he exposed himself to at least 11 women walking around Westwood over the course of the previous year.

After submitting his plea, Lanning immediately received a sentence of 52 weekends in jail, said Frank Mateljan, the deputy director for the city attorney’s office.

Mateljan said if Lanning does not complete the 52 weekends by December 2019, he’ll be sentenced to one year and three months in jail.

Sign up for our breaking news email newsletter: When major local news happens, you will be the first to know. Subscribe here

Lanning was also placed on four years of probation and was ordered to attended psychological counseling sessions on weekdays. He was ordered to stay away from UCLA and the Westwood area. He’ll also be registered as a sex offender for life.

According to the city attorney’s statement, Lanning’s flashing spree started in January 2017. Investigators said he would drive through neighborhoods near UCLA seeking women walking alone.

Upon finding a potential victim, Lanning would then ask the women directions to the 405 freeway to draw them closer to his vehicle. That’s when he would expose himself while masturbating, according to a UCLA police alert from January.

UCLA police said in January that Lanning was not a student and was not associated with the university.