Ricky Martin was told coming out as gay would ''end'' his career.

The 'Livin' La Vida Loca' hitmaker - who married his partner Jwan Yosef earlier this month - held off from confirming his sexuality until 2018 because his worried pals thought it would damage his reputation, while he was also reluctant to speak out because he'd grown up being told his feelings were ''evil''.

He told talk show host Trevor Noah: ''My friend, you have no idea how it took me a while. The thing is that I was surrounded by friends that were telling me, 'Don't! Don't come out that will be the end of your career.' It was people that love me, people that mean well and people that were just victims of homophobia.

''You know, I grew up in this culture that told me that my feelings were horrible, that my feelings were evil.

''And if you add to that, you know, that I was like a heartthrob, like a sex symbol. Everyone was telling me that it was going to be the end of my career.''

But the 46-year-old singer admitted it was ''extremely painful'' keeping quiet about who he really was, and the birth of his twin sons Matteo and Valentino, who were born via surrogate in 2008, drove him to speak out.

He said: ''It was extremely painful until I said, 'I can't take it anymore. It's all about me now, it's not about what's happening outside, it's about what I need in order to be happy.'

''I had my kids and then I said, 'I have to come out, I'm not going to lie to these beautiful kids.' To lie? No, that's not the point.

''And you know, life works in cycles, it's very interesting. Look at what I'm doing today, I'm talking on behalf of people that continue to hurt and through acting.''