The Latin pop singer records and performs mostly in Spanish, but has a huge crossover following in English thanks in large part to his 1999 smash hit "Livin' La Vida Loca" ("Livin' the Crazy Life") and his chart-topping "She Bangs" the following year.
Martin, 38, told his fans that his decision to divulge his sexual orientation marks "an amazing turning point in my life" and it started a few months ago when he began the process of writing his memoirs.
"From the moment I wrote the first phrase I was sure the book was the tool that was going to help me free myself from things I was carrying within me for a long time," Martin wrote on his website.
He said the secret over time had become "too heavy for me to keep inside" and that he joyfully embraces his gay identity as "something worth celebrating."
The pop singer added that he did not come out earlier because advisers over the years had warned that he might ruin his career were he to reveal to his fans that he is gay.
He was also worried about the impact on his young twin sons, who were conceived with the assistance of a surrogate mother.
"Many people told me... 'all the years you've worked and everything you've built will collapse'," he wrote.
"Allowing myself to be seduced by fear and insecurity became a self-fulfilling prophecy of sabotage. Today I take full responsibility for my decisions and my actions."
Coming out "fills me with strength and courage," Martin said.
"Today is my day, this is my time, and this is my moment."
Like a number of pop stars of his generation, Martin was a stage and recording star from childhood. He rose to fame as a member of the Puerto Rican boy band "Menudo" in the 1980s, before striking out on a solo career.
Fans were mostly supportive of the singer. His website lit up with postings from supporters writing in Spanish and English, praising him for his decision to live his life honestly and openly.
One fan on Martin's website offered "congratulations on finally freeing yourself from the ball and chain that living a closeted life is."
Another, who went by the name Libracolo, wrote that "the people who genuinely respect you as a father and an artist could care less who you are sleeping with."
"Continue to live your life with the same amount of dignity and pride you have done so far and let the naysayers and the haters burn in hell."
Another, whose signature was merely "proud of you," wrote: "I am so proud of the BIG step you've taken today. I have seen what many of my gay friends go through when hiding their true identity and it's a shame.... I'm sure the people that truly love you (the ones who really matter) will continue to love and are proud of this big step."
But the posts also included a smattering of negative correspondence like the one sent from "sorry for you," who taunted "your soul will burn in hell!"
The five-time Grammy award winner has also been hailed for his philanthropic efforts including his work as a UNICEF goodwill ambassador and the creation of his Puerto Rico-based Ricky Martin Foundation to promote health, education and social justice for children around the world.