A former Millbrae teacher who pleaded no contest to secretly filming girls in a school bathroom has been sentenced to two years in prison.

David Lista, 36, entered the plea in August to two felony counts related to drug and child porn possession, as well as two misdemeanor counts of improper peeping.

The sentence is part of a plea deal that prosecutors say will spare victims from having to testify at trial.

Lista taught English at Mills High School for 10 years.

Authorities arrested Lista in March after the school found images of female students on his computer from pinhole cameras he allegedly installed above bathroom stalls and under classroom desks.

A search of his home also turned up child porn and drugs.

Information from: San Francisco Chronicle.