A Freeport man — formerly a coach and teacher at a Queens high school — was sentenced to 2 to 6 years in prison for sending sexually explicit photos and videos of himself to a 15-year-old student, Queens prosecutors said.

Luis Rodriguez, 45, who coached and taught at Richmond Hill High School, was convicted in December of attempted use of a child in a sexual performance, first-degree disseminating indecent material to minors and endangering the welfare of a child, according to a news release from Queens District Attorney Richard Brown.

Supreme Court Justice Ira Margulis sentenced Rodriguez Thursday, the release said.

Brown said Rodriguez engaged in sexually explicit communications with a female student, 15, between October 2014 and November 2014.

advertisement | advertise on newsday

“The defendant was a trusted coach and teacher,” Brown said. “He was someone whom parents believed their children would be safe with. But this defendant violated that trust. This coach used an extracurricular school activity to prey on this young victim.”

According to trial testimony, at various times between Oct. 1, 2014, and Nov. 7, 2014, Rodriguez texted or used video chat on a cellphone to send sexually explicit messages.