Pop star Justin Bieber shared intimate details about his life in an interview published this week, opening up about how he abstained from sex for over a year so he could feel closer to God.

In Vogue, Justin Bieber admits to having a “legitimate problem with sex” and claims that he was celibate before marrying model Hailey Bieber.

When the couple reconnected last June, Justin was more than a year into a self-imposed tenure of celibacy. He had what he calls “a legitimate problem with sex.” It was his remaining vice, an addiction that had long since ceased to provide him any pleasure. Not having sex, he decided, was a way for him to feel closer to God. “He doesn’t ask us not to have sex for him because he wants rules and stuff,” Justin explains. “He’s like, I’m trying to protect you from hurt and pain. I think sex can cause a lot of pain. Sometimes people have sex because they don’t feel good enough. Because they lack self-worth. Women do that, and guys do that. I wanted to rededicate myself to God in that way because I really felt it was better for the condition of my soul. And I believe that God blessed me with Hailey as a result. There are perks. You get rewarded for good behavior.”

The “Sorry” singer also reflects on his past behavior and problems with drugs and alcohol.

“I found myself doing things that I was so ashamed of, being super-promiscuous and stuff, and I think I used Xanax because I was so ashamed,” the 24-year-old said.  “My mom always said to treat women with respect. For me that was always in my head while I was doing it, so I could never enjoy it.”

“Drugs put a screen between me and what I was doing. It got pretty dark. I think there were times when my security was coming in late at night to check my pulse and see if I was still breathing.”

Indeed, Bieber has a past of erratic behavior, including a feud with his Los Angeles neighbors that culminated in him serving probation and paying damages for egging their house.

In recent years, he has become more religious, joining the Hillsong Church.