Psychologist Dr. Robi Ludwig has apologized for comments she made suggesting mass shooter Elliot Rodger might have been fighting “homosexual impulses.”

In a now deleted YouTube video titled Elliot Rodger's Retribution posted before the 22-year-old gunned down six people near the University of California Santa Barbara, Rodger, dubbed by the media the “virgin killer,” ranted against the women who had rejected him and the men they gave themselves to.

During an appearance on Fox News' Justice with Judge Jeanine, Ludwig questioned Rodger's sexual orientation as a possible motive.

“When I was first listening to him, I was like, 'Oh, he's angry with women for rejecting him,'” Ludwig said. “And then I started to have a different idea: Is this somebody who is trying to fight against his homosexual impulses?”

“Was he angry with women because they were taking away men from him?” she added.

Later she added, “Was he angry at the men for not choosing him? This was a kid who was just angry in general. He probably felt rejected. He couldn't connect. He couldn't feel loved. He couldn't feel successful. Maybe he couldn't even feel like a real man?”

The comments gained wide traction on social media, where Ludwig faced a backlash.

She explained in a Facebook post that her comments had been misunderstood.

“I was misunderstood on @FoxNews this weekend, when I was asked to hypothesize several factors which could have triggered ?#?ElliotRoger?'s spree killing,” Ludwig wrote. “I in NO way meant to indicate being a homosexual or having homosexual impulses is a cause for spree killing. My job on @judgejeanine was to asses several possible triggers for #ElliotRoger and his behavior ?#?peace? ?#?forequalrights. ? However, I apologize to all those who felt offended. That was never my intention.”