A Bahamian man charged with hacking into celebrities’ email accounts to steal unpublished movie and TV scripts and private sex tapes pleaded guilty to copyright violations and identity theft in federal court in Manhattan on Monday.

Alonzo Knowles, 24, was arrested last year after meeting with an undercover agent in an effort to sell 15 scripts for $80,000. He admitted in his plea that he had stolen at least 25 scripts.

“I am sorry for my actions,” Knowles said to U.S. District Judge Paul Engelmayer.

Knowles was identified when he tried to peddle scripts of upcoming episodes of a TV series, the government said, and then told an undercover that he got access to the material by sneaking a virus into the emails of sports, entertainment and media celebrities.

He also offered sexually explicit videos stolen from email accounts, including a clip stolen from the account of a “radio host,” the government charged, and supplied a copy of a passport, social security number and other personal information of a film actor.

advertisement | advertise on newsday

The government did not identify the scripts and celebrities involved, and Knowles did not name anyone during his plea.

Sentencing guidelines call for Knowles to receive 27 to 33 months in prison, and he faces up to 10 years in prison. His sentencing was set for Aug. 25.