The singer said writing his memoirs had helped him with his decision
Puerto Rican pop star Ricky Martin has announced he is gay, ending years of speculation over his sexuality.
Martin, who has sold more than 60 million albums, said in a statement on his website he was "proud to say" he was "a fortunate homosexual man".
He added that he had kept his sexuality hidden because advisers had told him coming out could hurt his career.
Martin's biggest hit is Livin' La Vida Loca - a 1999 single that reached number one in more than 20 countries.
The singer, who began his career in the 1980s with Puerto Rican boy band Menudo, also had hits with She Bangs and Shake Your Bon Bon.
Martin, who fathered two children with a surrogate mother two years ago, said his decision to write his memoirs had helped him to free "things that were too heavy to keep inside".
"Not sharing with the world my entire truth" about his sexuality, he continued, had become "a self-fulfilling prophecy of sabotage".
Becoming a father, he went on, had convinced him "enough [was] enough" and that things "had to change".
"To keep living as I did... would be to indirectly diminish the glow that my kids were born with," he said in a posting written in both English and Spanish.
Martin had previously remained tight-lipped about his sexual orientation, refusing to answer interviewer Barbara Walters when she raised the topic in 2000.
In recent years the singer has become an advocate for children's charities, setting up his own foundation against human trafficking.