The author of a bestselling Christian book about relationships has announced he no longer identifies as religious and has rescinded past comments he made about the LGBTQ community.

Joshua Harris, whose guide “I Kissed Dating Goodbye” sold almost 1 million copies globally after its 1997 publication, apologized to the LGBTQ community for the ways his “writing and speaking contributed to a culture of exclusion and bigotry” in an Instagram post Saturday. His change of heart comes just days after he announced that he and his wife would be getting a divorce.

In “I Kissed Dating Goodbye” and its sequel, “Boy Meets Girl: Say Hello to Courtship,” Harris instructed young Christians to avoid conventional dating. Instead, he proposed getting to know potential partners through group dates and by remaining sexually abstinent. His definition of abstinence included refraining from kissing, holding hands or spending time alone together.

“I Kissed Dating Goodbye” gained prominence in evangelical Christian youth groups and has been touted by reality TV family, the Duggars. However, in recent years it has since been criticized for its heteronormative view of relationships, “rape supportive messaging,” “sexism” and “sexual purity teachings” that “reduce the agency of young women.”

The book also featured a passage in which Harris said he felt “anger and disgust” after being "checked out" by three gay men. "It was so wrong, so filthy," Harris wrote.

Harris acknowledged that he began “repenting” for his past views of women and the teaching of his books several years prior to his public Instagram post. Last year, he issued a statement in which he said “I no longer agree with its central idea that dating should be avoided” and that “dating can be a healthy part of a person learning the qualities that matter most in a partner.”

He went so far as to ask his publisher, Multnomah, to discontinue printing the book. They came to the agreement that after the copies in inventory were sold, “I Kissed Dating Goodbye” would not be reprinted.

Yet Harris, a former pastor at the evangelical megachurch Covenant Life Church, said this was the first time he was repenting for his words and actions against the LGBTQ community in particular.

“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,” Harris wrote. “I regret standing against marriage equality, for not affirming you and your place in the church.”

Harris, the son of Christian homeschooling pioneers Gregg and Sono Harris, wrote “I Kissed Dating Goodbye” when he was 21 years old.

"While I stand by my book's call to sincerely love others, my thinking has changed significantly in the past 20 years,” he wrote.

Religious identity and LGBTQ acceptance are often positioned as antithetical. However, “solid majorities of all major religious groups” in the United States support laws protecting LGBTQ people from discrimination in housing, public accommodations and the workplace, and support for same-sex relationships is growing among those groups, according to the nonpartisan, nonprofit Public Religion Research Institute’s 2017 and 2018 “American Values Atlas” reports.

Harris’ announcements have been met with mixed reactions from the Christian community.

In an op-ed for The Christian Post, evangelical activist Mike Farris criticized Harris for separating himself from Christianity.

"I do commend you for the intellectual integrity for recognizing that your secondary views (embracing the LGBT agenda, etc.) are utterly inconsistent with Christianity — as is your view that it is ok to walk away from your marriage for the reasons you have stated," Farris wrote. "Both of these proved that you had renounced Christianity before you said so publicly."

Despite disapproval from some religious leaders, Harris said he’s overcome with the “expressions of love” he’s received.

“I am learning that no group has the market cornered on grace,” he wrote. “This week I’ve received grace from Christians, atheists, evangelicals, straight people, LGBTQ people, and everyone in between.”

Follow NBC Out on Twitter, Facebook & Instagram