Elizabeth Smart's father had a revelation of his own ... he's gay.

Ed Smart says he and his wife, Lois, are divorcing and he will no longer live a lie, insinuating he contemplated suicide while he kept his secret ... "Living with the pain and guilt I have for so many years, not willing to accept the truth about my orientation has at times brought me to the point where I question whether life was still worth living."

As you know, Elizabeth's kidnapping made national headlines back in 2002, when she was 14. She was held captive for 9 months, raped and drugged.

Ed Smart, once a devout Mormon, is breaking from the Church ...saying he doesn't "find solace any longer" from the Church of Jesus Christ of Latter-day Saints.

The Church has traditionally been draconian over the LGBTQ community, but has softened its views ... somewhat. It has recently reversed course, no longer preaching same-sex relationships are a sin. The Church still considers same-sex relationships "a serious transgression."

Ed says he believes in God ... "In the end, people are free to say what they will, and believe what they want, but there is one voice more important than any other, that of my Savior, who wants each of us to love one another, to be honest and joyful and find a meaningful life."

Elizabeth is not voicing support for her dad's decision, only saying she's "deeply saddened" that her parents are splitting.