A former relationship guru and megachurch pastor who advocated premarital purity in his million-selling 1997 book "I Kissed Dating Goodbye" now says he's "not a Christian" -- and he hopes gay people will forgive him for contributing "to a culture of exclusion and bigotry."

"I have undergone a massive shift in regard to my faith in Jesus," Joshua Harris announced. "By all the measurements that I have for defining a Christian, I am not a Christian."

Harris posted his explanation Friday on Instagram, where he announced earlier in July that he and his wife, Shannon, are divorcing.

Harris quit as senior pastor at the Covenant Life Church in Maryland in 2015, renounced his bestseller and moved to Canada.

"I have lived in repentance for the past several years," he wrote, "--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. But I specifically want to add to this list now: to the LGBTQ+ community, I want to say that I am sorry for the views that I taught in my books and as a pastor regarding sexuality. I regret standing against marriage equality, for not affirming you and your place in the church, and for any ways that my writing and speaking contributed to a culture of exclusion and bigotry. I hope you can forgive me."