SANTA CRUZ, Calif. -

A Santa Cruz surf instructor was sentenced Tuesday to three years in prison after pleading no contest to 25 charges of molestation and child pornography possession.

Dylan David Greiner, 39, was arrested in 2013 on charges that he was secretly recording videos of girls getting undressed. Greiner was the operator of the Santa Cruz Surf School and also taught lessons through the Boys and Girls Club.

Police said that during their investigation, they found more than half a million pornographic videos and photographs on his computers. Greiner was also charged with molesting two girls, one age 14 and one older than 14.

In Santa Cruz County Superior Court Tuesday, Greiner pleaded no contest the more than 20 charges against him, ranging from lewd acts with a minor to possession of child pornography, unlawful recording and sending harmful material to a minor.

Prosecutor Rafael Vazquez said it was an open plea, not a plea deal.

Greiner was sentenced to three years in state prison with credit for the approximately one year he's spent in County Jail. He will have to register for life as a sex offender and will be subject to restitution involving two of the victims. Vazquez said he also will be prohibited from having contact with those two victims for 10 years under a protective order.

Vazquez had argued for a longer prison sentence; the defense pushed for probation.

“Dylan Greiner used his position and reputation as a respected business owner, and surf instructor to gain the trust of two underage girls and he shattered that trust when he physically exploited both girls to satisfy his insatiable sexual desires," Vazquez said. "Although he never engaged in skin-to-skin genital contact when he massaged the 14- and 15-year-old victims, and notwithstanding the fact that the images of the underage girls he photographed did not depict nudity, his conduct is undoubtedly egregious and caused irreparable emotional damage."