He preached empowerment — but was impotent.

Keith Raniere, the accused founder of alleged upstate sex cult Nxivm, had problems in the bedroom but tried to cover it up by lying, one of his “sex slaves” testified Thursday.

The woman, only identified as Daniela, recalled in detail how Raniere allegedly “groomed” her for sex on her 18th birthday — but balked because she wasn’t thin enough.

“Later, when you had sexual encounters with the defendant [Raniere], would there be times when he had difficulty getting or maintain an erection?” Assistant US Attorney Moira Penza asked.

“Yes,” said the witness, now 33.

Raniere faces up to life in prison on sex-trafficking charges for allegedly recruiting a harem of sex slaves by peddling Nxivm as a self-empowerment organization.

Jurors in the ongoing Brooklyn federal trial have heard testimony about the self-styled guru’s twisted sexual proclivities — but heard for the first time Thursday about his apparent erectile dysfunction.

Soon after Raniere performed oral sex on Daniela on her 18th birthday in 2003 in Clifton Park, she recalled him insisting that they’d actually had sex.

“You’re a responsible person. How come you didn’t ask me to use protection?” she remembered him asking her.

“I didn’t think he’d penetrated me,” she testified. “He was telling me he had penetrated me.”

She added, “That’s still a point of debate. I was there. It’s my body … I’m sure he did not penetrate me then.”

At one point, Daniela told jurors that she didn’t remember Raniere having an erection that day.

She said she believed she appealed to Raniere in part because she was a virgin. He nicknamed her “Norelco” after the shaver for her lack of pubic hair.

“By 2003, I had never been kissed, and I had never had any sexual contact,” Daniela said.

“So the defendant knew you were a virgin?” Penza asked.

“Yes,” she responded. “As he would come to call it, I was pure.”

“I thought he was celibate,” she added.

Raniere — who prosecutors said forced his slaves to remain painfully thin and sport brands of his initials in their nether regions — demanded that Daniela lose weight before they had sex.

“I needed to lose weight. He said that, um, that for him to share his sexual energy, he was very sensitive to that,” she recalled. “So when a woman was overweight, fat, it disrupted his energy.”

He said she needed to weigh 155 pounds in order to have sex on her 18th birthday, which she tried to attain by dieting and taking laxatives — to no avail.

“I felt rejected,” Daniela said. “He said, ‘You don’t care about me. You care more to eat food, more than you care about me?'”