SAN JOSE — A former Dartmouth Middle School music teacher was charged Wednesday with repeatedly molesting two former female students over a period of years, starting when they were both 13.

Samuel Neipp, 34, of Gilroy is facing 35 felony charges, including 17 counts of lewd and lascivious acts with children under 14.

He faces a maximum punishment of more than 100 years to life in state prison if he is convicted, prosecutor Michel Amaral said Wednesday outside court.

Santa Clara County Superior Court by Judge Vanessa A. Zecher set bail at $2.375 million, rejecting the prosecution’s request for no bail.

Neipp’s attorney, Sam Polverino, argued he was not a flight risk and noted his family was in court to support him. Neipp did not speak.

“I would emphasize these are allegations,” Polverino told the judge. “Nothing is proven.”

The allegations surfaced recently after Neipp allegedly threatened to post nude photos online of one of his victims, now 16, Amaral said. The girl has accused him of molesting her for about three years.

The other victim, now 20, came forward after hearing he had been arrested. She said the abuse went on for two years.

Amaral said police suspect there could be other victims and encouraged them to come forward.

“Although we have two victims right now, the investigation is just brand new,” Amaral said.

Neipp worked full-time at the middle school from 2010 until earlier this month. He also worked as a band and music teacher on a limited basis at two other schools, Branham High and Campbell Adult and Community Education.