The co-founder and president of accused upstate sex cult Nxivm broke down in tears Wednesday as she admitted to hacking into emails of the group’s perceived enemies and destroying evidence that could be used against them.

Nancy Salzman, 64, who pleaded guilty to a single charge of racketeering conspiracy, sobbed as she apologized for drawing her daughter, Lauren — who is also charged in the case — into the group, which prosecutors have described as a perverted pyramid organization.

“I want you to know I am pleading guilty because I am, in fact, guilty,” she said in Brooklyn federal court, her voice breaking. “I accept that some of the things I did were not just wrong, but sometimes criminal.

“I justified them by saying that what we were doing was for the greater good,” she told Judge Nicholas Garaufis. “I am deeply sorry for the trouble I caused my daughter, [and] the pain I caused my parents.

“I still believe that some of what we did was good,” she added.

Salzman, also known as “Prefect,” co-founded the self-proclaimed self help group with Keith Raniere in the 1990s.

Raniere, alongside “Smallville” actress Allison Mack, Seagram heir Claire Bronfman and Salzman’s daughter Lauren, still face sex trafficking, kidnapping, money laundering and other charges for allegedly coercing women into having sex with Raniere.

Her lawyer Robert Soloway told The Post Tuesday that his client would not be cooperating against her fellow Nxians.

In her tearful statement, Salzman said she’d obtained passwords and user names to monitor suspected moles within the organization and see if they were revealing the group’s secrets.

She also confessed to “having others destroy video tapes” memorializing Raniere’s teachings.

The former psychiatric nurse lives in Albany, and has been battling undisclosed health problems. Neither her daughter nor the other co-defendants were in court.

Prosecutors allege there was a secret sex-slave ring inside Nxivm, called DOS, in which women were starved, branded, and encouraged to have sex with Raniere.

Bronfman and Nxivm accountant Kathy Russell are charged with money laundering and racketeering, and have requested they be tried separately from Mack, Raniere and Lauren Salzman, who are also facing sex trafficking charges.

Lauren Salzman, who claims to have had a minor role the group, is also seeking a separate trial in order to distance herself from the troubling allegations surrounding the secret group.

Garaufis has yet to rule on their request. Opening statements are scheduled for April 29.

Salzman will remain out on bond until sentencing, which is currently scheduled for July 10.

Prosecutors have requested Salzman serve between 33 and 41 months.