A former counselor at a Melville day camp admitted in court Thursday that he tied up a then-9-year-old boy to a bed and sexually abused him while another counselor video-recorded it.

David Greenberg, 37, now of North Carolina, but formerly of Suffolk County, pleaded guilty to first-degree criminal sexual act and possessing a sexual performance by a child. He will be sentenced in October to 25 years in prison.

Moments later in Riverhead, Suffolk County Court Judge Barbara Kahn sentenced Greenberg’s friend and co-counselor at Kenwal Day Camp, Keith Meyn, to 15 years in prison for use of a child in a sexual performance.

The mother of the boy, now 13, held up a photo of her son and dared Meyn to look at him. Meyn, 35, of Oakdale, turned away.

“I know you don’t want to look,” the mother said. “He’s better than you. You tried to destroy an innocent child, but he’s better than you.”

Assistant District Attorney John Cortes said that what the two men did to the boy, who was not a camper, and others who were campers, was “shocking. It’s horrific.”

“We just learned of Keith Meyn’s guilty plea and sentencing and to the best of our knowledge, the charges against Mr. Meyn do not involve our camp or campers,” camp director Howard Feinstein said in a statement. “We commend the authorities for their work in bringing him to justice and we will continue to maintain policies and procedures that keep our campers safe.”

Sign up for The Classroom newsletter. Education on Long Island is changing. Find out how. By clicking Sign up, you agree to our privacy policy.

Greenberg is already serving 25 to 35 years in North Carolina, where he had pornography of the boy and committed sex and child pornography crimes involving others as well, Cortes said.

During questioning by Cortes, Greenberg said he was involved in the Civil Air Patrol child cadet program and mentored children there before becoming a counselor at Camp Kenwal for several years.

At the camp, he said he took sexually explicit photographs of the boys and kept the pictures on a computer.

He also admitted having sex with Meyn while watching a video of underage boys engaged in sexual activity. Greenberg initially balked at admitting that until Cortes said he would “prefer not to have to play the video” they used in open court, but would if he had to.

Another time, Greenberg said he and Meyn gave underage boys alcohol in a vehicle, and then recorded them exposing themselves.

Greenberg said the boy he abused was a family friend and sometimes he would baby-sit him. From the time the boy was 8 to 11 years old, Greenberg engaged in what Cortes called “chronic sexual abuse of the child,” sometimes in front of Meyn.

Meyn declined to speak when he was sentenced.

His attorney, Donald Mates Jr. of Hauppauge, said he planned to appeal the sentence as “unduly harsh for his minimal involvement in what is a horrific act.”

Another Kenwal counselor, Jay Marcello, 25, of Wantagh, has charges pending of touching campers inappropriately and disseminating indecent material to them.

Cortes said the camp itself does not face criminal charges.