(CNN) A former pastor who wrote a bestselling book on traditional relationships has confirmed the end of his marriage, apologized for opposing LGBTQ rights and announced he is no longer a Christian.

Joshua Harris' book "I Kissed Dating Goodbye," which railed against sex before marriage and homosexuality, sold over 1 million copies and became a fixture in Christian youth groups after coming out 22 years ago.

But Harris now says the 1997 work "contributed to a culture of exclusion and bigotry," and that he has "undergone a massive shift in regard to my faith in Jesus."

Writing on Instagram , he added: "By all the measurements that I have for defining a Christian, I am not a Christian."

"I have lived in repentance for the past several years -- repenting of my self-righteousness, my fear-based approach to life, the teaching of my books, my views of women in the church, and my approach to parenting to name a few," Harris wrote in the post.

Read More