Singer-actor Ricky Martin revealed in a new interview that coming out gay was “extremely painful” for him.

The 46-year-old Martin made his comments during an appearance on Comedy Central's The Daily Show. Martin was on the show to promote American Crime Story: The Assassination of Gianni Versace, the FX miniseries from producer Ryan Murphy that details the murder of fashion designer Gianni Versace. Martin plays Versace's longtime boyfriend on the show.

Martin, who came out gay in 2010 after denying rumors about his sexuality for years, said that he was warned that being publicly open about his sexuality would ruin his career.

“I was surrounded by a lot of friends that were telling me, 'Don't! Don't come out. It will be the end of your career!' People that love me. People that mean well. People that were just victims of homophobia,” Martin said.

“It was extremely painful for me 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.'”

He added that becoming a father to twin boys Matteo and Valentino settled the issue in his mind. “I'm not going to lie to these beautiful kids,” he said.

(Related: Ricky Martin reveals he's married to Jwan Yosef.)